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

|
网页之跑马灯文字特效
//修改宽度8 R8 ^% y! v( x9 `- a8 i
var marqueewidth=300, S4 ~! w+ U! M6 W7 i' C' w9 E$ K, v
//高度0 [" J Q6 [4 M w# e' I; T7 f
var marqueeheight=25& b3 d: A- P1 S! ^% f. L7 S' j9 e
//速度(1-10)2 B* a$ V0 j; D4 I
var marqueespeed=3
# g* @7 |' ~8 F, G4 G! K; \4 u4 n//背景颜色
! f* s* |$ g. h& q) bvar marqueebgcolor="#FFFFFF"
1 M1 @ F1 F# K; D& l//是否能暂停 (0=no. 1=yes)?( t) @( |! N; }# O6 K
var pauseit=1) n b5 g/ X# M, |
; ?1 y- J- R% M
//修改显示内容
% e) S0 b2 v3 N& z) ]- E: rvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
# ]: ]& y3 z8 |6 I( Z; t: j. ^) h. L1 y$ D5 }
% }: b- @, z5 H+ ^- l////下面不需改变////////////" x+ Z" Z1 b% a
5 ^ D2 ?1 ^. O! S2 j: f3 N7 D
var copyspeed=marqueespeed
$ ^" b9 U! ?' @3 l/ K3 M0 tvar pausespeed=(pauseit==0)? copyspeed: 0
( T8 @% A4 G; _( \! bvar iedom=document.all||document.getElementById
9 A6 W) W; z) u$ Y# bif (iedom)+ E- ?8 X8 n+ {7 {$ @
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
8 `6 N- x: e$ W' d" Y7 Y. o# Mvar actualwidth='') N4 C3 m5 G6 |) \$ @8 l0 s' Q; ]: d% W
var cross_marquee, ns_marquee
$ r1 L. l# t/ w+ Y6 x, _# A1 p2 x' H' y; k- h+ }, |& k3 J- S5 X
function populate(){
1 Z0 C0 i0 ]& @% [if (iedom){
0 }1 r3 o5 D3 M% e6 Scross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
$ k0 v! ]; R% ncross_marquee.style.left=marqueewidth+8
4 I0 Z: ]% ~+ L/ ^3 G; _7 zcross_marquee.innerHTML=marqueecontent1 }" m7 z6 @* x' ^3 }9 ]. y* \
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
" ~" A# }4 ^4 ~ ~6 Q6 l9 f4 C5 `}
! |! Z5 N7 G- G* }, ]* i( y, Uelse if (document.layers){
5 p# x% E% s2 b: dns_marquee=document.ns_marquee.document.ns_marquee2% s3 g+ g, y/ e+ h7 l9 A
ns_marquee.left=marqueewidth+89 D( I4 ]6 c* s* l; W4 v
ns_marquee.document.write(marqueecontent)6 d8 y0 m( h! g. _
ns_marquee.document.close()
+ i+ y' ^7 O( i. yactualwidth=ns_marquee.document.width
6 O" ^2 O2 L; u4 R; ], W: ^}
2 R! K* z8 D9 g$ J# ilefttime=setInterval("scrollmarquee()",20), F9 R Z$ ?, {; W* x- P$ G0 l
}
2 O) _2 v; M* [4 ^window.onload=populate
/ x- a7 Z4 H$ ?1 Z8 B/ z
: D' X: Z7 U# G0 yfunction scrollmarquee(){
0 n$ y9 M% S; S9 v: [ R+ tif (iedom){
: e4 H- ?" ] ?if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
- K1 b6 b F5 k& d& rcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed: F! ]7 A, n: A7 G* m7 E
else# Q3 n# D) R* L) |; k
cross_marquee.style.left=marqueewidth+8% i, D: k5 o2 N) h' l
* \+ \0 [+ V1 f5 ^# P}% f+ h V% e2 R* o* w
else if (document.layers){- c% r: H" L& r+ U9 ]
if (ns_marquee.left>(actualwidth*(-1)+8))
' d" t' k# y2 z+ w; w/ ^4 @9 t3 W+ sns_marquee.left-=copyspeed1 m& _( p7 i) M
else8 Y3 I8 |3 }+ l* m3 b& r, d& U
ns_marquee.left=marqueewidth+81 f0 Q' ~' o6 Q
}
& U7 K3 K- L, s2 F: x( `}" ~# w0 d2 D* e6 X, K% N/ F
* H, Y# m7 ^! Z' cif (iedom||document.layers){& f3 U% [# x. z" C
with (document){+ E7 ]$ m9 x U8 R
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
8 M* G$ W, [( e7 I4 R& `if (iedom){
- a1 r9 E! o* k5 Q/ Q# t3 U0 Iwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
, o! _8 s$ f% _' b; owrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')- G5 d5 l2 J9 B" \( l
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
, e5 e- u8 G3 _* i7 X( dwrite('</div>')
) U% r# I g9 [8 T$ M! {; \3 r}/ O% e; Z- n0 S2 n/ `; R B
else if (document.layers){. {6 i o1 A2 {8 g2 ^4 N
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')% T7 M; Y6 X1 k+ a
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
1 s3 R7 P- z7 J2 [write('</ilayer>')
2 y- o6 g v6 L7 ]}
% q! h+ \+ a( v: M" odocument.write('</td></table>'): [5 F7 j% \; k9 u! }5 f# L5 S
}. U: F( _' V; g
}
! z# g+ c, H+ |( s</script> |
|