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

|
网页之跑马灯文字特效
//修改宽度
4 Z8 t; Z! e: tvar marqueewidth=300
+ l: N& Y S: i2 ]7 @' C! d" I//高度6 I( w( }% p( _1 ^9 m. b& R o3 w
var marqueeheight=25
2 E, s8 B l5 d8 T8 k//速度(1-10)- v( S8 s% ~; U
var marqueespeed=3* j( h9 b6 ^ F+ @, A3 b2 j
//背景颜色+ h& c6 C: a" N7 H& A( O- w6 _; j2 B
var marqueebgcolor="#FFFFFF"
) }. e; t+ \8 H- s5 _* X7 h! ]//是否能暂停 (0=no. 1=yes)?
/ v4 S0 l- O2 X4 Kvar pauseit=1
, E {8 ?& S2 E% A' F2 \$ ^8 S' L
& p, U3 I+ v8 i4 q, o4 Q- V% e7 X//修改显示内容
+ G+ Z) A2 |, H' F" ~0 Kvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'; r- j3 x6 E; _( m1 k j* o" F
' Q. f; s) R1 f* J* e+ Y3 n
* u( N, g7 s% R n; [# Q% w4 d////下面不需改变////////////
7 |9 K( h, i- z- b9 m1 g. n8 [$ `3 a8 ~9 C! B4 Y
var copyspeed=marqueespeed
5 A1 z- n5 q9 n# l2 Dvar pausespeed=(pauseit==0)? copyspeed: 0+ V& b9 w: l1 P0 a1 e$ `. Z
var iedom=document.all||document.getElementById( L5 w d; y' m
if (iedom)6 [6 t5 U2 u$ d: K
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')5 K1 ^6 S/ h, m
var actualwidth=''/ c2 h) ^( ^! t- @" f, f
var cross_marquee, ns_marquee& Z* m9 e; {' T \+ z
4 l8 ?- |5 E5 e# v0 o8 v
function populate(){
( T: D; X( @1 m4 v/ X3 mif (iedom){
! p9 b8 |- R$ f6 y3 [. K4 x Ccross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee v$ T1 u# n* q, I& C
cross_marquee.style.left=marqueewidth+8' e. o, s; M& V/ R
cross_marquee.innerHTML=marqueecontent
, K! _# L8 }' N/ Vactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth7 F: |8 ^4 R5 r
}, e2 ]$ ^ f" J+ f0 b# W
else if (document.layers){* O/ y; M; i. U3 S" S* F0 n
ns_marquee=document.ns_marquee.document.ns_marquee2
; Z6 q3 h- d- Uns_marquee.left=marqueewidth+8! e% [2 v: ?6 O3 w5 ^- x
ns_marquee.document.write(marqueecontent)3 B v. S: o- ~1 O: |$ [& n1 K
ns_marquee.document.close()
" y! {% Z8 q1 F& P f8 i& P& B( Uactualwidth=ns_marquee.document.width
% F+ Q F6 |' A5 S% ]) q}
+ `% J3 H5 W2 Y# L+ Flefttime=setInterval("scrollmarquee()",20)" @4 U' U' h- \1 E7 u
}
2 Z+ F* @7 L: y0 }7 Twindow.onload=populate
; i1 P" h4 j% ^5 }3 M" ^9 Q5 l8 y( b3 I1 {4 r
function scrollmarquee(){ E: z5 E1 a o7 r' T4 z; h9 t
if (iedom){
. K7 ^% `& S& w% R: F: O) iif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))/ }* E# _. `4 F# g& A8 o. }5 T
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
' s5 O6 S1 D1 b1 Q2 r- D xelse+ G* @. k) O: p* p
cross_marquee.style.left=marqueewidth+8
' d% K0 O A3 w5 i9 e2 Y7 C8 E$ m+ f( B7 K4 p4 n# W* V
}
8 E) t1 k0 K: R* B# _+ g! ]else if (document.layers){2 [( b! ]* Z! R. F2 P. ?9 O' Y
if (ns_marquee.left>(actualwidth*(-1)+8))
; l5 t) I, K! m t' O* ~: fns_marquee.left-=copyspeed, M/ J3 b+ L6 f2 T( r
else
; A5 I8 |$ o/ x5 x9 d+ V$ Rns_marquee.left=marqueewidth+85 `5 p0 S. k* u2 H$ N2 x
}: J. G3 O. |5 e9 W9 V
}
( M8 V; D, n8 U
! F6 f; d$ c; {if (iedom||document.layers){
1 f4 E) X L7 i( B( b. ewith (document){
; |! x$ l; Z/ d$ B, \; R6 m0 D+ Y% tdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>'): Y4 T' x/ P3 Q8 F' }
if (iedom){# r* r n5 h( ?
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
( b$ o6 a5 n+ d+ {( N: C* cwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
# V& ?9 R) @/ P4 X: X Awrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
5 ~8 P# P/ m4 Hwrite('</div>')5 j0 {+ y8 R, m- @& H+ v9 s
} O; ?# o$ ]( h' J6 i
else if (document.layers){
" r, l3 `! V8 ~. cwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
0 z' K1 R- O2 {write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
! i$ m/ n& `! T) z" X9 F, K _write('</ilayer>')6 l: N. Z. T2 A) i9 S/ y
}
3 A* I# t: f9 |- V- Xdocument.write('</td></table>')
" V! U" X; W, R. }) }& u}
* W# z4 ^, K& c) r( i: n}
$ z0 p. j6 |! p+ E0 C c1 a</script> |
|