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

|
网页之跑马灯文字特效
//修改宽度2 P3 m! q9 K8 ?, ?0 o
var marqueewidth=3002 i9 X. u) M3 y* [8 P! `! w/ i
//高度6 a8 p- m+ x! W; C: \) _7 `
var marqueeheight=25- e* h h: o+ V l
//速度(1-10)
/ V, g' i | V& h! lvar marqueespeed=3
/ u s0 z5 ^7 B" B5 A, J//背景颜色
% ^2 G m/ B& n" w# v6 Zvar marqueebgcolor="#FFFFFF" @$ f' y- L- y5 N
//是否能暂停 (0=no. 1=yes)?8 @) j/ S* G8 K/ a- e0 ~
var pauseit=1& y9 [) Z; {5 Z
* q1 G5 d d5 M
//修改显示内容
6 g& ?( q/ e( Cvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
: I4 M9 A$ ?) u# _* J' b* ] e: V$ W" e& \
2 G* D2 \% s! r7 M" X" _. P+ E////下面不需改变////////////
/ V3 K1 L$ _- q5 s5 ]
4 i. y* G& I! ^. fvar copyspeed=marqueespeed
8 j6 N% @$ n" N- nvar pausespeed=(pauseit==0)? copyspeed: 0% q& |! } J& l" O0 x5 ~6 Z% g1 L
var iedom=document.all||document.getElementById: n& _: y& Y9 S
if (iedom)* ~' T+ T& O: N$ {: F
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')) L% C: `& E V+ N4 G
var actualwidth=''# e; l4 t( t( m. v
var cross_marquee, ns_marquee; n# H1 M: {1 J8 m# e, B! E a
: m5 l% {4 D5 ^: }5 s6 v c
function populate(){, ?+ I/ A8 U* S7 n& Z
if (iedom){
, d5 d/ `8 n9 fcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
' I! m, w; k! Icross_marquee.style.left=marqueewidth+80 S% y0 K+ i* _) w
cross_marquee.innerHTML=marqueecontent" b- I% C. d, Y a* r. f
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth% z# u- r! \! C/ E9 R: Z8 \
}- D$ Y9 Z @. n. s$ d; L- K
else if (document.layers){- g7 n/ [2 x: V/ m
ns_marquee=document.ns_marquee.document.ns_marquee2$ O' p3 ]% @$ D6 K
ns_marquee.left=marqueewidth+8" q- p$ O7 L, a! V E
ns_marquee.document.write(marqueecontent)7 u6 ~7 S5 ^& N, [0 u1 d' w
ns_marquee.document.close(); B/ K4 E+ S( e; H+ u
actualwidth=ns_marquee.document.width0 B+ N# w1 y+ b7 R. e
}
4 v! \6 o8 ^% a/ h' Blefttime=setInterval("scrollmarquee()",20)
2 {; n' e0 E3 L9 _}
- J6 C8 U$ ]" u) C7 P. {# [& i1 _window.onload=populate# k) Y& X& J h4 Z( b+ F1 g
( l1 W2 V) `3 r% L4 j3 ]function scrollmarquee(){7 b8 f7 p2 K- Z1 c' D; H! u
if (iedom){
" ?# w+ X. V5 K$ }+ Y/ Oif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
4 w- D) y# y4 fcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
7 G- E! |, [3 `# C7 w; Aelse7 ^6 |' C! r. u8 g& `8 M
cross_marquee.style.left=marqueewidth+8
& ~8 z0 _+ x2 o/ b1 H4 }& \: r2 w8 |
}
: G' g. a$ ?) Z! Velse if (document.layers){. G U/ |6 m! G j! u7 j4 H
if (ns_marquee.left>(actualwidth*(-1)+8))
" i" N1 B# a% P3 _1 y- [ns_marquee.left-=copyspeed8 {5 o- ?; h) P$ P
else" y! \- K8 f m* W/ j1 \
ns_marquee.left=marqueewidth+81 Y. q/ u9 Q0 e e! @
}. Y8 W0 O5 |2 Z! `+ G, w
}
. y K0 _2 [$ P4 B* V$ g% ~
' \5 A( n; r8 | U/ O$ vif (iedom||document.layers){
, e, _" z& v3 Y1 A3 lwith (document){
/ u6 r. a& C5 N8 J; [document.write('<table border="0" cellspacing="0" cellpadding="0"><td>'), V! V/ n6 V3 ]( j9 F
if (iedom){" y. {+ Q" y( @
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
( X7 l8 r% {, g$ v) Uwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
$ U% R6 E, i# t' K9 J0 }+ owrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
( c, y, m% v# p1 g% x' z5 Dwrite('</div>')
- d5 N( F/ S$ o! Q! B}
j- y" Y* g; B- E; O5 D0 Q. Jelse if (document.layers){
. j0 L2 L8 F5 T+ ^! s2 ywrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')/ q7 Y8 m; p0 ~! V H
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
% n, W" `$ G0 X1 F( b1 [/ d: E5 ewrite('</ilayer>')
8 c% M9 v+ i4 W, R}
$ N0 F* R. F5 p6 _( b1 c$ T5 W3 Rdocument.write('</td></table>')7 ^$ h& U( R0 ~' ?0 `
}6 s! r' s# J4 |9 s* Q8 F& W
}
! O; B2 [% x4 v</script> |
|