返回列表 发帖

网页之跑马灯文字特效

//修改宽度7 q7 \3 H" }! m* g8 `
var marqueewidth=3005 z1 j6 W- ]1 W6 \0 h$ ]! i/ \+ D
//高度
# v/ g: S: p7 C0 W7 jvar marqueeheight=258 L$ f% R2 n4 O( A
//速度(1-10)+ b% C' a! E& H$ q  j+ G
var marqueespeed=30 T: P1 E4 _7 Q4 U% o7 Z9 d
//背景颜色6 c% {. I& N  Y* B" V
var marqueebgcolor="#FFFFFF". @$ h: U0 |9 U4 q8 l4 U
//是否能暂停 (0=no. 1=yes)?
; J5 w) l% C( Q* p4 m9 n* Z" @var pauseit=1
. Y# j: g( T. ~! V/ Z; s$ z  f) X* K6 z- g
//修改显示内容  M8 H& G2 X+ m; n7 }7 v
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
. |/ w+ X5 R. e) ^: l8 e3 `
5 |& S4 d( A2 {, V( i+ V6 {) a: I6 N: M' ~: N/ d* ?6 B9 d
////下面不需改变////////////
  G6 u5 u1 k0 H1 r6 e% c$ n: K9 C& d& c% g" R8 ~/ R3 I& M
var copyspeed=marqueespeed
* b- t/ y9 U. L5 H2 n& B% gvar pausespeed=(pauseit==0)? copyspeed: 0- K. _, v* C, y" b; w9 ]
var iedom=document.all||document.getElementById
; x/ i8 Q+ C7 [* dif (iedom)/ H2 w. Q8 m. A+ l$ Z+ _% y+ h; N7 U
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')3 R  L8 f) T- I! `
var actualwidth=''
- {8 z& {1 g" y- s6 W% rvar cross_marquee, ns_marquee
! z8 k4 H. o" {; g( G& h4 c
6 ~  i; R& N, k0 ]* N  Rfunction populate(){
  A! X2 B* b* Nif (iedom){+ t  Y2 n" U/ O9 ]& ^5 X8 W
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
7 \7 F; e) `3 e  W6 Ucross_marquee.style.left=marqueewidth+83 G& ~3 _$ K. @+ M: l/ w: f
cross_marquee.innerHTML=marqueecontent
4 z5 g: n" E. Oactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
3 d( y+ [  ~) z6 t, K9 d}
1 S: b3 B! P0 m+ U$ ~2 g9 ~- nelse if (document.layers){
+ M' S* h* t+ {, _ns_marquee=document.ns_marquee.document.ns_marquee2% _3 x4 ?) f7 b! Q
ns_marquee.left=marqueewidth+8
# ]- [6 }0 H' }' D8 G) `ns_marquee.document.write(marqueecontent)4 }. A1 e$ e5 K, l( J
ns_marquee.document.close()$ ~4 w' m  L7 i3 M' l
actualwidth=ns_marquee.document.width
5 u+ ^' b/ P  |6 z  y+ k! R( q}
1 h0 z7 s7 e8 B! V; t4 @lefttime=setInterval("scrollmarquee()",20)& k  h# {1 x  S4 v
}& u2 T0 Y, \# l( r# _
window.onload=populate
. E6 _/ [$ c/ L, C# R2 t9 H
) u& k" p8 u5 }function scrollmarquee(){4 g9 }  M" v8 ^
if (iedom){
9 ^9 O8 I' j$ o% |1 U! Iif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
/ {, M, T) R% g4 Wcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
9 |. U( u/ L0 J) \, \4 ]7 `6 Velse
+ J( T( u9 M- Gcross_marquee.style.left=marqueewidth+86 l5 F* L) m/ l, Z; v) N
) [, z/ F9 ^$ s! i- ^  S- W1 L' M
}
9 F! [  q. _5 b/ }else if (document.layers){
+ |3 \' T: W# U+ J& x( Uif (ns_marquee.left>(actualwidth*(-1)+8))
( y( n8 {5 v3 W' C* s2 b$ @" Hns_marquee.left-=copyspeed
2 {3 ^( K6 i& {: Pelse8 A) r+ `4 l5 ]: I+ V3 i( e
ns_marquee.left=marqueewidth+8. O0 h& R7 |/ a! y7 N$ ^8 M6 ?0 c
}
: F) x8 V, b. f* I- d$ j- m, M}: t3 V7 U% P/ W/ E: S& q! v

1 @' Q: H( A5 i8 ]if (iedom||document.layers){' `9 c! z2 h- Z6 ]" m( i
with (document){5 V" f7 I( c8 {- ^( I
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')5 u. r' j# u7 b% j( w! e4 r. s/ z
if (iedom){) g# M6 x  [, P% S1 i
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
/ Y, {" K* x5 Owrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
2 \& D/ F: m9 R5 O) y9 S/ Cwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 I6 _# @( F0 L. ?2 Zwrite('</div>')
7 g7 u4 t' c/ V0 a$ ~' I}8 D+ u& m) W# L; `! R7 _& w1 n$ l+ _. f) L
else if (document.layers){
8 g7 F# M! H2 e) L" ?+ `# bwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
9 `' i& _6 A" P* U: H0 K; ^write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
8 H7 L( I$ [+ E' K; o. [- n& E. gwrite('</ilayer>')- ]. M/ @) r% |8 F) d# i
}
) T0 J! T  X* w; idocument.write('</td></table>')
1 A- r2 H) @( o9 G}" S2 q! l: j; L/ U% v
}5 \' V, ~: B, c0 z* b
</script>

返回列表
【捌玖网络】已经运行: