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

|
网页之跑马灯文字特效
//修改宽度* y5 @; w# F* z8 r" e" S3 I
var marqueewidth=3009 b, a/ b+ V2 ]' L
//高度
$ H, V+ X9 I9 C# F/ v5 Fvar marqueeheight=25) M Y- X' c2 f6 N) x& w. C. x
//速度(1-10)
: o; X. T" q) b9 t* O; Ivar marqueespeed=3
E) W9 L# G' _$ t$ o: r//背景颜色$ P2 W1 V: F( L& E
var marqueebgcolor="#FFFFFF"+ F8 m8 U0 @8 G& A) I; g/ ^8 G# ~
//是否能暂停 (0=no. 1=yes)?+ d$ }& _! D. H0 g. M1 [
var pauseit=1% d1 Q D- ?) A4 a2 c- u
; H* r6 F5 y% ~- T( [//修改显示内容" B# k; q. h, Z- r
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>', l( r* `* _: h9 T! o, s g+ _
5 S+ ]5 v* S% d$ I+ c. X" }
' O* p/ r1 N/ x* v////下面不需改变////////////5 R. B% d" P( T( e; k! }
, p# B: m. K: c( ~8 \) r! }
var copyspeed=marqueespeed4 Y3 c8 u" F1 ^# N8 ]1 |
var pausespeed=(pauseit==0)? copyspeed: 0. p8 h- a, \. H5 E8 e
var iedom=document.all||document.getElementById
( @' ^/ p" H! i0 h9 y: ^if (iedom)
8 ^' r" O) g& t6 ]4 }! kdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
" [# G; ?- o: `- S0 p$ i8 \, Hvar actualwidth=''. E' T8 u5 Y0 h9 B* i6 d: ~
var cross_marquee, ns_marquee
) _, o* R6 R9 W1 F' z
, {" P8 e, V7 rfunction populate(){
) k/ c4 D- c# _if (iedom){4 p5 n) E0 I$ v1 w& h, z p
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
. ?/ d. V1 F" Z7 Y, h7 x) zcross_marquee.style.left=marqueewidth+8
) L' j: T3 U$ e# @% v' Across_marquee.innerHTML=marqueecontent
# \) d2 E5 R9 [0 k0 A0 S1 mactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
5 N) J: s7 }$ ]+ J}
( n5 a+ [: p/ J1 Q% Celse if (document.layers){- X$ W$ Y" h2 W
ns_marquee=document.ns_marquee.document.ns_marquee2/ A7 B" |- r: P6 D
ns_marquee.left=marqueewidth+8 v# {. @ n e& p- L7 o
ns_marquee.document.write(marqueecontent)/ D! t1 S) P+ N: m% g' ~. q, Y* h8 I
ns_marquee.document.close()8 _4 Q/ g5 `/ q& i2 E9 i1 u" {
actualwidth=ns_marquee.document.width" V' _8 F, s2 I+ H' ~
}
/ @8 o! x- U3 G1 j1 {3 C' h5 [lefttime=setInterval("scrollmarquee()",20)
: g# q; H& J2 J+ N i}5 u! M$ ]: x) ?3 }, l C
window.onload=populate
5 L) E, }2 E- o% J% j; J
1 {2 O* \: i$ R, `% k/ mfunction scrollmarquee(){1 ]1 f$ A" X* D0 |) G, \! q6 u0 b
if (iedom){" K% n+ H( L9 ~) C
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)): v5 T) S! w+ @' D( I6 S3 v
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
& M5 U& v% ?# D: ~, Z& t* Yelse) H" x) c+ t( ^5 H+ p+ s
cross_marquee.style.left=marqueewidth+8' f4 R8 i* A* z4 [0 ^, Z
! w( } R: d% l; O
}( n0 t/ s7 n" X! d: K( C" A
else if (document.layers){
# f2 M; R( G/ @/ I: |if (ns_marquee.left>(actualwidth*(-1)+8))+ n8 D4 _& U$ i
ns_marquee.left-=copyspeed# v& N! H. k/ `6 \
else
; h) h: o3 d2 v& m% w( Gns_marquee.left=marqueewidth+8
5 k0 ?, ~8 B- w2 S, s, Y$ I}& }0 R, f" w9 n) O% J2 q
}/ ~; O4 l7 I1 a. a8 ? l
8 ]3 |" W' d/ i2 [, Z) \- G) h3 iif (iedom||document.layers){' [/ o3 b' f) X" L
with (document){
4 M# K7 Y' p a0 g0 qdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')& B1 l% {. D; o& W+ ]$ [8 E7 j2 i
if (iedom){( n3 V& Q8 ]4 O
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'); S0 q% y" l2 r. m- C% K
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
& i7 s; {1 c2 v3 jwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
2 I {* d- k" u( P. E- Z( W$ {write('</div>')) w. k D! P$ L0 q
}: U) g" K: W9 W0 ^+ M! _
else if (document.layers){* r1 U+ o: g; X
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')( {0 F8 {. Q" `3 y c
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
" t/ M' b! d; r) bwrite('</ilayer>')9 U( L+ q' e; k" F3 i& m
}
2 B9 J, X$ K% s X3 J2 n+ ydocument.write('</td></table>')
8 K. J/ R$ D% @, v+ w}
2 o& x( E) ?* U6 P: j: o}8 X) _1 j! l# q2 @- [7 R: l
</script> |
|