|
  
- UID
- 133
- 帖子
- 51
- 精华
- 1
- 积分
- 186
- 金币
- 55
- 威望
- 2
- 贡献
- 0

|
网页之跑马灯文字特效
//修改宽度8 \; |6 A7 J4 O9 ~
var marqueewidth=300# J4 J# A0 J( N0 \0 c: o5 o' h
//高度
2 \! F: J/ e: t2 ?4 h* h. [! [2 Jvar marqueeheight=25. V* r- b: |) w6 u5 ?
//速度(1-10)' D2 s" {) {" b3 C* s! P
var marqueespeed=3
2 C; c# e- y+ S! o3 l, j4 z+ r//背景颜色
/ n: m7 G$ P) b: Q7 Fvar marqueebgcolor="#FFFFFF"# T2 |# Q, J s
//是否能暂停 (0=no. 1=yes)?
$ X1 G: H! ?) p0 w/ H9 ]1 N& bvar pauseit=10 K+ l3 g7 M$ c
; e( F/ ~/ S1 S7 T& }% V
//修改显示内容
5 W8 O: T2 e+ o: S j0 r7 y( V8 Jvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>', b8 J5 w$ g, k: C; j% f% W. O2 I
" @3 M3 _$ C3 t
/ r2 q8 i$ ~2 M) F( M5 f////下面不需改变////////////. _ E3 P# z' a" ^) y* t" A
! c7 V' o& }; e3 f
var copyspeed=marqueespeed
: x. b, ?& A2 ?' Yvar pausespeed=(pauseit==0)? copyspeed: 0
8 |/ f" K# s. Ivar iedom=document.all||document.getElementById& @% N9 d9 W% N- a, Z$ O
if (iedom)
; n5 P( o: ^; T4 Fdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')2 P$ ~0 a& o, \9 [+ N5 H/ R% ^
var actualwidth='': p' `% ~. e( I( J2 v
var cross_marquee, ns_marquee
% |4 }- T5 n: E) J7 W7 r
7 l+ `2 |: R3 zfunction populate(){* v% o3 ?8 A! W) I3 M' h, j
if (iedom){( |2 Z1 [. q; l: U9 P; w+ l
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
$ U# `- L- w& \8 S+ G7 e6 f$ X) Zcross_marquee.style.left=marqueewidth+8
/ s9 X% S& p/ Fcross_marquee.innerHTML=marqueecontent
3 a# w: }7 @2 U' i9 y; O+ Jactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth% m% f5 H- S& O. K5 u
}6 W$ I. p6 }: K! F
else if (document.layers){- e9 F3 g1 }/ y/ B& p" T( I' U1 W# K
ns_marquee=document.ns_marquee.document.ns_marquee22 ]8 D3 C) L. U8 Z7 M" v
ns_marquee.left=marqueewidth+8
3 |/ |. c4 l" r. d& A2 Mns_marquee.document.write(marqueecontent)
& X8 V0 N1 q/ sns_marquee.document.close()
$ q% J$ j9 z; Y# factualwidth=ns_marquee.document.width' t6 I# G; e7 |7 {+ T" ]4 d
}
5 _/ M. |" ^5 Plefttime=setInterval("scrollmarquee()",20)9 j Q$ ^; a' H3 _
}
3 ?0 Y& G& {5 a' m* i. ?' F. Zwindow.onload=populate" _3 o. V$ D2 |6 @3 ]
* x7 N3 I& c/ e& nfunction scrollmarquee(){+ r6 H" v' Z9 n) y8 |
if (iedom){. _+ g/ t& X2 `- N# z, y) u4 ]
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)), L0 a. t- g8 u. u& Q3 P
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed7 r' V4 T( L, b3 q9 |/ g6 n) h
else0 P/ \8 e2 @& f' q
cross_marquee.style.left=marqueewidth+81 L1 V/ D7 E% {6 Y4 _5 ]" p
+ ~. y4 ~5 |7 l" j W}5 S$ Q2 R2 R/ _) T' M! r1 J* Q$ H
else if (document.layers){
4 }7 K% h% K0 l* `7 |3 dif (ns_marquee.left>(actualwidth*(-1)+8))
# V) f0 M, R% O: d9 J$ K: J; yns_marquee.left-=copyspeed
2 J/ j' l" B! felse
0 |8 ]* i5 A) C7 }+ \4 |7 o+ bns_marquee.left=marqueewidth+8/ Z) P! t1 M6 o! e5 b" ~
}1 r1 k( M {0 L7 s+ ?+ d
}" H5 V6 [* v* t! m# X
4 v; y1 q/ R" E7 X
if (iedom||document.layers){1 g& t* P2 |0 t- h2 Y
with (document){
, z: M2 k, F( ]: }" _1 d& H0 A/ Jdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
$ w: F. M6 V6 z) Rif (iedom){
: {$ b1 i# y( L/ y3 twrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
2 }% `& _2 q3 \& ]* R# ~write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')4 m3 y4 M$ l+ z8 Z$ U0 v
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
. n4 _! w; \/ ?* M8 p* [write('</div>'). a# x% J% z# Y# L
}
; |/ j! ?8 _' m+ X X& t- kelse if (document.layers){! X2 v' y, d0 S* J) W
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
$ j( ^6 ]# S5 rwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'). {' {- T2 X) F' D9 o
write('</ilayer>')5 z: z2 D" i1 W% z4 O* i: V
}
) X- z, d* |* x7 p3 ?6 f; u4 Xdocument.write('</td></table>')$ d1 D( ^1 ^$ e3 U5 ]
}- b/ m9 w3 F& U
}
+ h+ B" Z2 l% E( n9 k+ o4 {</script> |
|