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

|
网页之跑马灯文字特效
//修改宽度
6 O4 O9 I# T: {) s4 g6 ~var marqueewidth=300
: ]4 k4 W' W$ m o0 P5 d7 O+ d5 Q//高度! F( |+ D' Q1 |! N. E7 x' ]
var marqueeheight=25
2 S7 u) o5 U2 n9 ?9 g//速度(1-10)" Y0 }- b. B: ^8 X/ P. u
var marqueespeed=3
. O! ?4 L P- Z; Y//背景颜色
`" e' D' G2 a9 L# Bvar marqueebgcolor="#FFFFFF". V* M2 _+ o4 l" \- m# N
//是否能暂停 (0=no. 1=yes)?
3 J1 {" `# l: ]8 S3 ?8 Lvar pauseit=1
# w, E$ g7 @8 m; ~: Q- Z
) @- r7 L Q2 B( x8 V3 s; H//修改显示内容3 i/ `, G M4 w$ i( P
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'4 F: _* l- |0 U* G. m# f4 c
6 _! @- g% |/ Y+ g7 k1 [
& B: `* B8 y9 P! Y( {3 c' y2 J" a////下面不需改变////////////
, a6 n2 `8 G: T; `7 y' S* j9 H$ v. e
var copyspeed=marqueespeed
7 S9 x8 O/ v& H1 I/ Lvar pausespeed=(pauseit==0)? copyspeed: 04 U% g* S; P( w" g( a
var iedom=document.all||document.getElementById' P6 t$ ?3 M1 o& }: q I* a
if (iedom)
" q) U6 d5 U' K& u! C* kdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')2 B u7 Z8 c. `+ B/ r
var actualwidth=''2 O4 r- p% a. g8 G( a7 z* Q
var cross_marquee, ns_marquee7 }$ ] S1 w- k6 _9 J( @" k, w
6 x' a% m. l+ m& ~4 {) zfunction populate(){2 {; A+ X) @- i" P
if (iedom){* _* R; r0 n5 H, e' A
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
. |! ?% J( O' ^cross_marquee.style.left=marqueewidth+8
9 h/ B5 O+ y8 M! h1 M Y+ Xcross_marquee.innerHTML=marqueecontent- M, _' p, }9 q1 n& D9 U
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth1 s. m1 V o& ]9 n* Z9 D$ J
}6 m2 H6 F5 B9 u
else if (document.layers){
# p* _. {6 Y8 kns_marquee=document.ns_marquee.document.ns_marquee2) {. E" l, P0 \* U* D
ns_marquee.left=marqueewidth+8+ s. |& N' `7 P
ns_marquee.document.write(marqueecontent)
/ [* \, ?% ~) M; R6 Z3 w- @3 Fns_marquee.document.close()
- r6 @! G( i3 oactualwidth=ns_marquee.document.width6 U# w- _0 s+ C8 }' S+ l
}* `3 J: M G. L7 A# W% ]
lefttime=setInterval("scrollmarquee()",20)
9 E1 V4 j3 {# ?1 ?. k- ]$ Q% R}
' k! q: h7 j; K$ y' ]3 A( c# Pwindow.onload=populate4 ^ ]5 s3 B7 [! y- n- H
5 D: @- S. s8 R( M! pfunction scrollmarquee(){% J( l6 I/ H4 L/ c8 V
if (iedom){5 y, `+ W5 x6 \# c3 s
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
, y v6 q+ J$ \) z: X8 f( gcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed9 I3 z3 O# q" |1 ]) ~7 r+ d- V2 r, V
else
k \8 w7 k* h) j% `cross_marquee.style.left=marqueewidth+8
* c' O8 T3 m+ U3 L
4 ^) M( V: n* ^+ {* d: E}& Z7 L7 A, X h' z7 ?
else if (document.layers){ v! _, W: Y$ I) h% v1 G6 H
if (ns_marquee.left>(actualwidth*(-1)+8))0 P( d/ Q, v$ Z, \
ns_marquee.left-=copyspeed
- f5 Q) @2 h" b( P4 I. t+ c# J3 e% Z" Helse
8 A/ a: R( S) A# Cns_marquee.left=marqueewidth+8$ q; v0 x1 V- |! t, ~1 e" g% Y
}* z1 V- n5 Q: k7 l" {* _! S2 D
}
2 q8 P) M" g) e9 b! K2 l5 X7 J8 c* a3 t! X
if (iedom||document.layers){
, E) Z8 o& H3 e3 ywith (document){
/ ]4 N$ e2 t3 A' p3 Idocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
z- h/ y7 X+ F2 A& N' @: z& aif (iedom){0 t" l" e& u4 r/ y2 ~0 _' e
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
: N/ L0 Q( v/ Swrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
1 E- l3 U' _# k1 a6 Gwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
/ h6 J7 u/ d# F* n7 v; }, o) H Mwrite('</div>')
& \0 K( t& i2 H9 L" Z" d) W}5 Y5 U0 z' S* d/ Z9 e ]/ ^8 ^* y
else if (document.layers){
9 |( O) o8 {5 Gwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')) {$ V/ Y1 ]' ? C
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'); C& [/ |8 l7 o" ~( V
write('</ilayer>')
3 l8 l c$ B! q! d+ a* K, h}
5 A8 K0 P* I) k5 M& |document.write('</td></table>'); O/ f9 K" Z( o
}
+ L6 ^& v' s3 J! t) u4 J( @1 E}
( v+ A3 ^; K9 I5 G# U</script> |
|