返回列表 发帖

网页之跑马灯文字特效

//修改宽度8 b3 N5 s1 Z; `  |
var marqueewidth=3003 w/ q7 \$ n8 `" f8 Z
//高度
3 e9 m2 i) |  h% B9 }var marqueeheight=252 c( [' I) s/ T, t/ q
//速度(1-10)
1 k4 f* ^% E. f/ Cvar marqueespeed=3
  _" {& a  p5 C: U9 x2 t' W0 O//背景颜色
% a$ ?; H) Z: F  R0 pvar marqueebgcolor="#FFFFFF"& {. a, Y2 E0 g( T3 z
//是否能暂停 (0=no. 1=yes)?
0 M* T& A. L! ]var pauseit=1
' G7 X3 x9 {5 |6 j& R/ q% q+ u/ n( k5 p3 N8 E3 t- s
//修改显示内容
8 d# Q/ E( u- }% jvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
, x6 O( @8 Y$ g: L% U" S3 u) |* ~
8 {! F. Q& I/ \* z/ f. P
/ _/ s: F* Q8 u4 C4 N* c) y9 u; L////下面不需改变///////////// p$ l1 A6 z4 c
9 A# f, `% z8 {0 l" C
var copyspeed=marqueespeed6 b  y3 B  b4 L; W8 d
var pausespeed=(pauseit==0)? copyspeed: 0
  f5 c! m5 l5 [1 W# ivar iedom=document.all||document.getElementById
! z" ?  y3 n5 v5 nif (iedom)9 X4 r* M+ I& z5 ]  n5 K
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')# u; T/ }" W5 b! p6 [
var actualwidth=''
; ^- a4 S' c  K2 s! kvar cross_marquee, ns_marquee) k! U4 z+ l+ r" \2 H' t
( C( f4 @; U) p  B& A! C
function populate(){& {& A3 V. O6 Y- {4 d
if (iedom){
. A; `* D6 g: g3 g+ {9 s$ M: Tcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
( U* r' y: a" u' across_marquee.style.left=marqueewidth+8
% A" A: D& J& u. m' s# i% Fcross_marquee.innerHTML=marqueecontent
# B8 S; e2 d: y" F% T* Sactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
  G+ e9 q6 {" \3 O- a" o" o}
+ b* s' Z, l/ o5 ^6 ], M/ O7 aelse if (document.layers){" u, Q9 g$ r- w' I% n
ns_marquee=document.ns_marquee.document.ns_marquee2
3 ]# s0 B& \. S; ~+ Ans_marquee.left=marqueewidth+8& J2 \: [$ I0 x! j& U- [4 ?1 g- J. _& U
ns_marquee.document.write(marqueecontent)/ d' t3 z$ u6 u" V
ns_marquee.document.close()
. m$ w: e! x! Q& [actualwidth=ns_marquee.document.width8 ?& d, _- h9 _, e. u
}  y% R2 f/ [8 S9 F7 m1 l9 z
lefttime=setInterval("scrollmarquee()",20)6 S3 ]3 q. X+ V, i  v$ F
}
3 Q6 e. v" G/ `! Twindow.onload=populate1 l7 N+ K; g  s/ R: n2 ~

/ P2 o3 A) B3 F; E) [$ R7 Zfunction scrollmarquee(){+ U* Y3 j' [' l0 [
if (iedom){- t& }2 L+ ~) D0 \1 Q/ O
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))4 |4 k" }! X, V/ i# V
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed! ?0 b" W& Q' c4 z/ ~3 a
else
& A3 K, v2 K/ Ocross_marquee.style.left=marqueewidth+8
+ H5 C3 w8 ^/ _9 ^) V2 c0 K1 B9 W$ ?8 a
}
( E2 \9 K, D3 `3 qelse if (document.layers){
/ o; x. z5 R) O: Q8 r) eif (ns_marquee.left>(actualwidth*(-1)+8))" S5 |& _% x. L  n2 a( I
ns_marquee.left-=copyspeed
9 G; U( R0 U9 uelse  s: N4 a# U9 f. s
ns_marquee.left=marqueewidth+8
8 K% R: B9 n! r1 l+ o8 e6 }}
" [6 I/ k" [, C) m( X: q( u}% J4 q4 W% w6 \- `. _" b

$ V5 \) Q6 S8 m3 G' K! }if (iedom||document.layers){! M: b& w+ E, B
with (document){5 a$ O7 ?+ {% l+ w- R/ x
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')8 ~5 [4 k% W; J# |4 H/ O+ w, I2 i- Z- t
if (iedom){
; J% K3 W- X/ n5 e) Fwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
. T) ]) q5 O  W9 C, U. ^7 Gwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
% ^5 `% C+ D: D1 {' U( ~5 V/ S- kwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 [5 ], O9 E$ J8 A5 f; e0 Pwrite('</div>'). u9 l% ^: o9 W2 B5 O6 F% N
}# u- q( s) c; R* @& j& n
else if (document.layers){/ w" s4 n% ?- G, ]/ S7 G- L
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
9 Q- a% |9 J& N! f7 Hwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')" {2 L3 k  D% w1 u. L7 y
write('</ilayer>')
3 t% E( Z' O( G0 {+ W}
6 u  X* h% k* r3 fdocument.write('</td></table>')( L# v- }; _) Y1 s
}. l0 p/ l, L8 m
}+ Q& u( K5 M& i7 Y; J3 e- R( o
</script>

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