返回列表 发帖

网页之跑马灯文字特效

//修改宽度
  \5 M# o6 q: b: d" y/ `: J7 wvar marqueewidth=3003 m- x* a7 S, d, p* ]8 E
//高度; e8 d1 Y, D3 W0 o. g$ D2 }
var marqueeheight=251 k) H( {% {! W! m8 A: F2 N
//速度(1-10)3 c8 A1 B- ]/ K: C* J4 T! C. z% Y
var marqueespeed=3% e8 x, u" w) ?/ ]+ u* o
//背景颜色
7 D6 r/ ~! k8 |3 ?( g7 Ivar marqueebgcolor="#FFFFFF"
2 f, m3 ^* B" O9 G//是否能暂停 (0=no. 1=yes)?
8 ~: u' {; E" [" N$ N% Q0 Uvar pauseit=1
4 L- e9 P4 }: z, z/ W" g1 }" H! Q# G7 S# D/ j8 \
//修改显示内容$ T; H% U; `% B/ x3 U' t# ^
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
/ N/ k0 C. E, O9 P* d; Q
' \. |1 b, w) X% s+ B; T$ F# l1 D1 `% X: c) l
////下面不需改变////////////
+ T$ v& e% ]/ C- Z& r, F  K* I/ r" D, k( D* R9 b, L
var copyspeed=marqueespeed, a; o1 G: Q' M0 ]) U+ a
var pausespeed=(pauseit==0)? copyspeed: 05 J2 Y: N* `+ F1 V1 k
var iedom=document.all||document.getElementById: r1 V; u2 }, C8 C& V/ M" p
if (iedom): j+ ?; x% G( }) s" K% M( j4 \
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')$ p' {. D) O3 p. i" a% G8 b
var actualwidth=''
5 P0 b# F0 B' ]6 Jvar cross_marquee, ns_marquee. e) s8 c1 b. R( F
& D7 L$ E, R; F: M
function populate(){' l# L) V# z- L" ~7 f# \5 T# W8 j& j
if (iedom){8 p: I( ^4 s- N% R( S, o
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
% ~1 D& e/ w) R. Z5 I- Z1 W( E9 Lcross_marquee.style.left=marqueewidth+8
# W- G- H3 m) M7 ^" F/ across_marquee.innerHTML=marqueecontent
9 [4 [/ f  Q; j! f, o# a( factualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
: y2 b2 B% \# ?0 H9 W}
9 C; D: ~: l1 s( G# X$ @, k) Celse if (document.layers){- ]" ^0 T* d* N7 N. h
ns_marquee=document.ns_marquee.document.ns_marquee2* p: }$ C+ P0 t
ns_marquee.left=marqueewidth+8
# q2 o& B! i6 ?1 J" d" jns_marquee.document.write(marqueecontent)
' q; F( j7 n% N  F$ d, F7 dns_marquee.document.close()& G  p  H8 i- t  w1 R# T& B5 r
actualwidth=ns_marquee.document.width/ u$ K' O1 B, u
}6 n1 y2 O4 U! m) q
lefttime=setInterval("scrollmarquee()",20): t9 P( P) w3 @
}
' m( k2 k  B$ T% B3 Q) C3 G: Fwindow.onload=populate1 E! V: m0 N0 D' ]3 j  Q

/ x: z8 d" \. V$ Z! {function scrollmarquee(){/ b0 k+ y7 g# I9 k3 t4 W
if (iedom){
$ x) Q$ N! r0 ~4 ^7 mif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
3 z* M" J3 n- x) Q9 bcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
4 e0 Q4 ^: b$ {else
" H, ^9 A, t9 B' Q% N) \cross_marquee.style.left=marqueewidth+81 K: S5 A- E0 u( u+ D

' V) y* N: A4 ~: `, V9 y}
+ S" ^4 n8 P- A: y7 Melse if (document.layers){& S( f/ U! u  u, K7 F& \0 o8 C
if (ns_marquee.left>(actualwidth*(-1)+8))
- {" q# x; c/ `" o- s' Uns_marquee.left-=copyspeed
$ A% E* o3 _; C' j( Ielse/ Z1 Y# A4 O' \- J# t% C3 ]8 \  h
ns_marquee.left=marqueewidth+8$ x' U8 y6 g, a* P
}
$ `+ q' [# Y. A* M1 C  m% N}
) J1 ^' e. ?5 N/ G( R5 q2 o" l6 Z* I* C) K( N0 E
if (iedom||document.layers){/ b" ?' Z2 S/ P$ ?, V& ^2 K
with (document){
) M$ x9 x: F, a5 a# {document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')9 [, z% f8 b# i: ^8 r6 p
if (iedom){+ S5 k% |+ C7 d) \3 U
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
: c* ?, ?( b+ r; z7 ~! ]* K! Wwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')7 q$ {' e" H% u  {: g9 y* ?, ?
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
+ K, E3 i& K/ M8 h" I: vwrite('</div>')
2 ^  @* V& {9 Y+ _2 G# B3 e}4 c9 t2 C. F  K4 x+ T- y9 I
else if (document.layers){5 |6 g4 J* P$ b7 v% O
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
  x! r+ o0 t3 Q' ]write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
/ }7 Y3 a3 h) Iwrite('</ilayer>')0 y% \* x6 `$ E7 w3 v: _8 P1 q
}: j5 Z% ]; k- i% ~$ ~. P
document.write('</td></table>')
; @9 O- a! {0 ]) n  K( h3 r7 Q2 L}
  A' X) r; Z3 g3 @5 H}
/ X9 `; h# I, Q6 z+ [% p0 a* X# T</script>

返回列表
【捌玖网络】已经运行: