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

|
网页之跑马灯文字特效
//修改宽度+ F& V/ `! p: B' Z Q
var marqueewidth=300& r3 o7 H* J& b% Z) \9 u& O
//高度, s- x7 M. g* u7 E2 z
var marqueeheight=25
' k) P/ U- u; u( M6 {. v' h- Z5 _//速度(1-10)) w- c4 [, b5 C) U
var marqueespeed=3
4 R* j0 H/ d& K$ a, c; J//背景颜色
& u; l. I$ f/ [# F3 wvar marqueebgcolor="#FFFFFF"9 ^" j0 G' ?" ^4 K
//是否能暂停 (0=no. 1=yes)?
. U0 ? E9 p/ V7 P& t; G4 ivar pauseit=19 I, o4 Z& @ x# L
& t+ t# ] g* F6 w3 R
//修改显示内容! W9 b" k: Y! N
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'/ s* R6 U6 k# Z) b
' r, ^4 r- ]- ^ J
/ G9 X3 N0 n2 M$ `) I6 n
////下面不需改变////////////
1 o% x; X$ t8 {' _( L- g/ G1 [3 ?1 M5 A% k! g- ~/ g4 T8 _# x
var copyspeed=marqueespeed
5 s1 b8 J$ K. l- Nvar pausespeed=(pauseit==0)? copyspeed: 0" }8 t5 q5 l% `+ z+ x, T2 ^$ ]
var iedom=document.all||document.getElementById4 L( `# b4 b/ H3 K5 [
if (iedom)( G* x9 f2 y2 J
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')" P, Z6 R! u5 F0 e% T, {/ i! I' T
var actualwidth=''% [, B9 c* d3 P* ?* ?/ N( b% c
var cross_marquee, ns_marquee' ^; P) |! O: J. V3 o) y
" W* q- C9 ]6 C' B) @8 h" \2 X' Pfunction populate(){
9 s* y( C) t7 g$ j3 kif (iedom){5 }$ A% ?5 {2 P# t5 d0 V4 v) _+ W
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee, K) A1 N: t2 }5 E2 {! \4 z: i
cross_marquee.style.left=marqueewidth+8* c4 w3 O# z; _, p/ y7 g9 V$ X
cross_marquee.innerHTML=marqueecontent+ N$ ]8 \9 b4 H
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
+ E6 M3 m3 z% O% h9 z+ x; L! c* q' r' H}3 F1 `3 w" d* \/ V: i4 @ p% b
else if (document.layers){
F4 {, q2 R9 N. u; ^ns_marquee=document.ns_marquee.document.ns_marquee22 G2 K0 A$ R! a: z1 s5 Z
ns_marquee.left=marqueewidth+8# h& o7 }3 K, n' a
ns_marquee.document.write(marqueecontent)8 r- |( F9 x9 a
ns_marquee.document.close()
" H0 T; E3 A; G2 @actualwidth=ns_marquee.document.width
! z7 m/ S+ V3 R7 D7 o7 k}
5 J4 T+ n5 u! D8 b% b1 dlefttime=setInterval("scrollmarquee()",20)# p4 Z1 s) m$ Z3 j' H" |% j4 e
}5 T3 F$ \& S' c+ y
window.onload=populate y! A! L3 k7 u3 B m
- S; j0 K' }: [. z
function scrollmarquee(){
$ x# n6 J6 g: h# eif (iedom){% R1 J. Q! r) S4 V1 x \8 e
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))( W& A* f( D6 F5 b4 }
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed. P: S3 e: Z) G- l
else
3 A) I4 {' {5 k. L5 s5 B! pcross_marquee.style.left=marqueewidth+8! S! X: E% s. A. y9 e
1 g+ U# X. G5 i! h, W0 n# b& z
}; }+ ], }9 V8 U, |: X3 e
else if (document.layers){
$ Z7 F6 K. ^" p& B! @1 P' J$ z: y+ Iif (ns_marquee.left>(actualwidth*(-1)+8))
6 Y4 E# H- O& d% D* r; Ans_marquee.left-=copyspeed8 `( U: r* m- V# Y/ ~5 ^5 B$ G
else
- D1 Y/ z: ?! d7 {ns_marquee.left=marqueewidth+8
?: c, W/ ?5 o7 [/ y3 R$ i& F}
$ j, X) I# V% l+ c}
# a2 D: h' S* M
& ^, P9 F1 b \' ]if (iedom||document.layers){# Q* X( z/ r l" z ]! B; p
with (document){
7 B* L8 S% S) \ ]; Idocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
" i* [! L# b m0 i* a1 q2 Aif (iedom){8 d9 I- J0 Q7 t! R+ C
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')# L; q5 ?& S$ o9 i$ d8 a# y* M
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
5 z/ |. U# N( ~; c9 b: p ], M& fwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
- ^6 \- m& |2 p: n6 vwrite('</div>')9 c% J! y" h( }3 {8 V/ m
}
# U" E4 z: ?1 E4 q' Kelse if (document.layers){$ k5 Q$ Q( e8 i. S9 l7 Z
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')4 o- G* A! `; c: U8 Y7 s+ C3 F
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')) r9 j) ^- }! C5 U; J2 \, ^4 w) F
write('</ilayer>')7 t3 \3 d( M1 M1 m8 x" o0 u9 H6 q
}
, e* ] j! h! k' b5 Bdocument.write('</td></table>')
/ `7 p' \, b7 Q( J}/ E0 D! y+ u" n5 |4 i) m- N$ k2 a
}
) N9 ^$ V" q0 P! Z5 [. |2 w</script> |
|