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

|
网页之跑马灯文字特效
//修改宽度* e- |9 C" Q/ B1 q Y! t1 y5 k
var marqueewidth=300: [6 O! ~3 l9 w' ]' Y
//高度
! G9 V& O" \. p% ?8 |var marqueeheight=259 J4 j6 O. a" h5 ^
//速度(1-10)8 }; E9 @' H$ h7 c; V7 `
var marqueespeed=30 `& H& C) `$ I0 o
//背景颜色9 X- n2 p- f+ U6 w4 ~, g
var marqueebgcolor="#FFFFFF"
2 H3 C6 }$ Z; O" Z( F! V3 m4 P, y//是否能暂停 (0=no. 1=yes)?
: g! F- C# ]$ {' s) F% gvar pauseit=1( ?/ v1 E2 a3 Y4 ?) n: ]9 u
' K2 _ I: i! W/ ^//修改显示内容% j1 D" Z5 y) |( ?: A
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
# M ~- d3 I- J8 j. Q
3 _# @! j5 J! z1 w" }
. g d+ s M, L- A+ h) h////下面不需改变////////////
' b2 X* M9 n, T m' ?* |$ m
1 h5 o! W% C* Z3 ^& K. Gvar copyspeed=marqueespeed
4 z& Y$ I# ]2 c: Zvar pausespeed=(pauseit==0)? copyspeed: 0
- g8 _9 x7 P6 J% f- { E/ Xvar iedom=document.all||document.getElementById8 S6 A% Y+ H. r8 r9 U1 A* t$ S
if (iedom)- u0 |, |/ M! x- G8 `
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
1 y$ O; g: y( L G2 evar actualwidth=''
4 j1 o) o. `- R) svar cross_marquee, ns_marquee. f! A) |* w) c' I5 I" H" e9 Q4 L
8 T! l; m$ a4 y4 P
function populate(){
1 a* S7 j8 O" \if (iedom){* J/ u2 i* N/ x9 B; B
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
; p3 y R) I" x& d: ?3 ocross_marquee.style.left=marqueewidth+8
5 T- r" P' \( M+ w; k4 Zcross_marquee.innerHTML=marqueecontent
. U7 M% f$ O* A3 Sactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
# s$ I/ |# w1 g) g0 S}6 `0 J+ T/ E% }+ L) J, Q* T+ u4 l. q
else if (document.layers){% h8 ~1 B! S2 U" I( K0 H
ns_marquee=document.ns_marquee.document.ns_marquee2
" Y: J; \+ l9 t2 Q6 J* ~* lns_marquee.left=marqueewidth+8
1 L* v) M& E$ q# ~3 Fns_marquee.document.write(marqueecontent)
+ l! Y d) P8 H1 Vns_marquee.document.close() Y p! A) N, i* B! C! Y
actualwidth=ns_marquee.document.width
+ [+ G6 b4 e& V8 O4 f' y: Q9 W}1 n1 H- [9 y- V7 x# P, ]
lefttime=setInterval("scrollmarquee()",20)
. B3 x' [ Z6 a+ {/ J}
" \/ d4 U+ r4 L: e: h6 ^window.onload=populate
3 N/ J. _% Y5 E: y
0 X' e3 k1 z' X5 s1 D9 Z$ tfunction scrollmarquee(){7 F( Y: W# }3 n2 X1 G7 E
if (iedom){: b, l( n$ I a5 F
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))5 F" s2 ^; b, U& }2 a- T5 n6 p
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
0 q8 I" O, M4 ^else
) @5 }6 ^* ]+ C, ncross_marquee.style.left=marqueewidth+8
4 v, h2 p) W0 a8 E I
6 M* d" ^1 h4 ? B}
, g% S. F2 ~) Y" R9 n$ {1 y! \else if (document.layers){
) c: u. ]/ Y/ y' L [if (ns_marquee.left>(actualwidth*(-1)+8))
4 x/ ^" q- P7 z! Mns_marquee.left-=copyspeed' w" Q* l& u5 N, l7 ?% D
else
/ [* `/ H5 {: @1 Zns_marquee.left=marqueewidth+8
) k1 P( k& y [/ _; a}
8 o3 P% P$ Y3 S! m8 _}- g# p. O, m, z( K* ^3 ]
" M% q% ]) i& L/ `2 _5 p9 ~if (iedom||document.layers){
0 w5 |* V7 l1 W; Y8 ~- \ D4 A; L" u4 }! rwith (document){
# ]# W6 s$ {% I, bdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')) L, `& ^6 _& z, X
if (iedom){: n; D" @# F- w0 q# ?' U
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')4 s5 K; a# Z4 W- y, f+ z
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')5 U6 V& Y; A: \5 v
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'). A$ [) m5 r# r5 `8 Q: I) o1 y
write('</div>')
" J1 _9 I- f! b$ n3 f- h. o- C}3 A" l, }7 S4 a, @ F
else if (document.layers){
/ r) x4 t; ~2 q% i2 Bwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
+ O0 B* u0 Y- {/ b' mwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
" K5 r2 N' @' h: gwrite('</ilayer>')6 W2 `7 o& d9 y8 D5 n1 P+ R6 ^
}
/ t) h+ t) R: B9 X$ ]) Jdocument.write('</td></table>')7 t- A# F' K* Z9 W
}
0 g# R. N- d q}
$ Y) k) s" n) a) J) L7 [</script> |
|