返回列表 发帖

网页之跑马灯文字特效

//修改宽度
- v4 i: ]  r( ^9 B1 Yvar marqueewidth=300
9 I8 ~" r/ k. f: d//高度
8 X/ g( b# n3 i! P, A) V: `% ?var marqueeheight=25
( C% U* S* r) w; y//速度(1-10)
/ H- I4 I  Q4 P/ F- Wvar marqueespeed=3
" u. F8 ~9 k* Z7 L9 |$ Z/ w//背景颜色
% H9 Y1 v5 [" h4 P7 B+ i9 }. [var marqueebgcolor="#FFFFFF"# @5 b1 [: S7 \4 _: O
//是否能暂停 (0=no. 1=yes)?8 K; L: @! z# z
var pauseit=1
8 |1 V6 \2 ~: p9 y
# B3 W& u; U4 S% f  y7 O5 T# k( J% }//修改显示内容) p% L+ k+ l& |( r5 @" Z
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'2 c. R+ z; f5 P4 k

3 \& s% x. m0 }% X* @# I
$ @: R( k4 L6 ^9 I////下面不需改变////////////
* C* d5 {0 _9 Y/ Q: V
$ y+ }9 H# R$ p4 y' Rvar copyspeed=marqueespeed$ o. Y) F" `- L) D- O) |
var pausespeed=(pauseit==0)? copyspeed: 0
& t  G% t; o' K4 M9 p( evar iedom=document.all||document.getElementById
3 m% u9 r5 h0 w3 G; B, kif (iedom)
8 d. o' ~5 o' G7 H3 ~- L/ H+ Zdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
6 s3 C& K3 W3 W; M$ V) o9 [var actualwidth='', j! o, s$ c6 q2 ]. f7 G4 b
var cross_marquee, ns_marquee- I8 }9 z7 X6 K1 z1 N' x5 M

' x5 Z& e, ^1 j9 Y. c; f4 ]' ifunction populate(){  ]0 ^, @/ c" @
if (iedom){, f1 L8 @4 a/ @/ y! K5 C
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee' x( b+ X( X" m4 v" E
cross_marquee.style.left=marqueewidth+8
  n$ ]9 c7 E: ?# k5 L( h7 lcross_marquee.innerHTML=marqueecontent
' t6 K% J+ k+ w% x# h% Aactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
1 {3 u6 c; C* R' ~  O& W3 @# N}
" o. c( ~9 ^9 U; lelse if (document.layers){. s: \1 A: D5 E* H/ k- k
ns_marquee=document.ns_marquee.document.ns_marquee2
. }+ k* s9 |) vns_marquee.left=marqueewidth+8( `( `& ^5 U& C1 x$ `8 X
ns_marquee.document.write(marqueecontent)1 Z# }  L7 ~2 h& M5 W0 n
ns_marquee.document.close()
  G+ `, [# d+ Ractualwidth=ns_marquee.document.width
& H  n# d! A: ~5 V! u, {% F1 V}; R0 S$ {7 b" a9 }3 [
lefttime=setInterval("scrollmarquee()",20)
( U, f! |8 u. g' ~}
- a- [" m8 h! Swindow.onload=populate
  Q2 l$ m' _" e) j3 F4 v( l  A
8 z- m$ H' d3 M# vfunction scrollmarquee(){: u* `# ^6 {0 o) j3 J1 g
if (iedom){
$ N  D. y, t6 U0 \! G) o) \if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
, q: p1 D, I9 B  I5 K% @cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed! u, I8 H3 l% o- a; ?' k+ s5 n4 @2 u
else
0 {" N$ y# b0 d3 T& j5 o9 Dcross_marquee.style.left=marqueewidth+8
9 t0 o  J$ Z9 p( U& U) g: _9 K  n" n4 _" C) W
}
2 n! E. w- ~; c/ ~% h) p4 }else if (document.layers){
' c( c" X4 T( O9 Y+ R  a; _- p8 N' @if (ns_marquee.left>(actualwidth*(-1)+8))
8 q5 g3 P* B; v5 d. z. Z0 Fns_marquee.left-=copyspeed% ^2 ^& i+ X, T- ]: `
else: t& t' i4 i, N  x$ i4 B# L
ns_marquee.left=marqueewidth+8
9 X& m5 K2 Z/ N6 X" Q}8 M% h$ F, W  V( \. w0 {! \$ P, l& L
}
( _% f# y+ w9 i$ p% ~" X0 Z1 x+ T6 w+ o4 a
if (iedom||document.layers){! I0 o9 X  ?* `& |* z. M8 |
with (document){- R9 m2 Q/ G5 d( o7 E! ^) [
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')" `- x, l* A/ F6 ]. y8 u. V
if (iedom){' U" e, t( p" |0 P; |% Y: U" |! G
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'); ^  v3 y1 r# t5 N! O) y
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')8 e5 G! j2 D5 w4 @% z; ~  v
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
" p- c9 c/ B9 P7 ]write('</div>')8 G# q+ ~+ ^$ d% G- ]2 U# k2 B
}
! V, p1 H+ n& O4 [else if (document.layers){
9 T  y% s! M/ |2 ywrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>'), q1 |. J  n; t% Q0 ]6 P8 N: g
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')) R( y: r1 R6 o6 J8 r% \' K/ W
write('</ilayer>')
3 V) p0 {; L  A- j( z. q# d, h}
# W: A: m) R  s2 i- r" Adocument.write('</td></table>')$ u: {# e% }* c* q' u6 k
}5 ]/ ~( K1 A+ H* i0 F' N
}
$ L( Z5 a; b  {( V. |</script>

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