返回列表 发帖

网页之跑马灯文字特效

//修改宽度
" ^4 }1 i- u# E  Mvar marqueewidth=3004 s6 q% C2 L3 c0 j1 t
//高度
# `6 R0 w$ q8 N$ p- j8 ~var marqueeheight=25. u+ Z, `# O! c4 i3 X! R. ~  I1 ^# A
//速度(1-10)1 h( ]( |; l/ s% }* s' x" b
var marqueespeed=33 C; i# K8 \) B% N
//背景颜色
& I  a& N1 F: w9 F2 m0 w7 Z: Gvar marqueebgcolor="#FFFFFF"
/ L# _9 s' i) Z0 l; W! K//是否能暂停 (0=no. 1=yes)?8 g# l' `9 z4 ^9 Q& q" @
var pauseit=1- l; ]% @: ~! b! U, z! ~. {

9 U6 Y3 l1 R2 O' P% B7 J0 Q//修改显示内容- T+ N+ C2 Y8 x$ J2 y( o
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'- v! ^2 T# x; d& q9 [4 o
3 r& X" x: e7 c% J

; ?! @/ D: L% ^, I////下面不需改变////////////
# b4 R+ {0 N; U9 X# m) |* W. H' M$ M* E2 @) n4 G
var copyspeed=marqueespeed  d6 {# [$ {: ?" `
var pausespeed=(pauseit==0)? copyspeed: 0/ o1 Q1 c- R5 w3 K4 L; z
var iedom=document.all||document.getElementById) D# F/ ?+ o2 \' J8 B, W: c6 _- h
if (iedom)7 c2 o( @( @" q0 K
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
4 K$ h3 H4 v' G1 E- H% Gvar actualwidth=''# A) a: y+ v0 v8 b9 f+ Z3 u8 N
var cross_marquee, ns_marquee1 C; ^1 j2 _' |+ F- ^

+ i8 k, Y* G) R4 Y7 T( a0 U7 rfunction populate(){
. E1 Z" ?( I6 H0 z2 I7 h6 zif (iedom){9 a1 V; x+ r8 O2 ^) @: j6 |
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
2 G" k2 }( Y3 t  {! F6 i4 `cross_marquee.style.left=marqueewidth+8) u0 y5 T- D' f8 C# I3 J8 J. c
cross_marquee.innerHTML=marqueecontent
8 n. Y9 S6 v- Z5 O8 P( S- Iactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth1 d* q, Z, d" v9 J' e* I
}
8 q+ [  w6 P* e" V/ M- _else if (document.layers){
, [/ R: ^- `  E- e! m( X( D% Nns_marquee=document.ns_marquee.document.ns_marquee29 N# m9 I  D& s; X" e+ @1 D
ns_marquee.left=marqueewidth+8
) s8 D  o1 O2 o7 _$ y" uns_marquee.document.write(marqueecontent)
+ K1 u1 Q9 Y1 d5 V$ V/ x: N1 G$ Q# yns_marquee.document.close()/ @8 m: C3 w8 d5 X
actualwidth=ns_marquee.document.width
4 q' w$ x0 {  }}
  h) P. v! Q: i5 N& h% Dlefttime=setInterval("scrollmarquee()",20)8 W9 r, H8 R3 C5 t7 X" z3 C0 B
}
; r# I# V$ `4 f9 F) ^+ p: }9 Dwindow.onload=populate
+ M) E; J% t1 L* O6 R: u
4 W. x4 f% u' E1 x! x; B' yfunction scrollmarquee(){
8 ?0 V# }! v  f5 rif (iedom){  J7 }* B$ P; G# C' }" I
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))% b, n  W1 t5 a4 M2 x4 i
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
9 b% o. B1 m( W: ?8 W- I! m, {else0 h6 E+ j% v5 X5 V7 N. e
cross_marquee.style.left=marqueewidth+8
0 q& W0 U. @! D- l: `# q5 A; p" ^% h6 J4 f
}
7 \+ i2 q5 i1 Q: [else if (document.layers){# k+ I  _2 h4 }" |) F+ D4 t$ @
if (ns_marquee.left>(actualwidth*(-1)+8))
6 t4 m; ^+ s8 kns_marquee.left-=copyspeed- ?# p( [" C0 l, Y3 a% ~. w
else4 O1 R- a& r' K) K9 o' j- }
ns_marquee.left=marqueewidth+8
) j5 z5 A% r( ]) X$ J: Q0 `0 G# A}+ o+ R2 ^2 _" R/ _% @; z  `
}: z' w' j  m0 Y; T4 T. W

* D0 ?) i( _) n3 ~4 u* ?if (iedom||document.layers){
8 G6 A+ A0 i$ G- g4 V  s! N2 @with (document){
/ V; Y( [, e0 M& H& o; M2 S" @document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
& V: Z4 j) O/ v& {" g/ a- fif (iedom){
& C, o6 s7 s+ B$ _6 t) q9 {0 Rwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')# G1 ~! Q+ A7 i8 X8 m5 o
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
1 h, A+ L' `5 W/ }write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')# C4 y4 Q* j# z+ A, o. s3 E
write('</div>')
8 ?9 h, h, t0 p! n}
( r. i  n6 c7 S' @5 B$ r- [& Felse if (document.layers){
1 w& G3 a8 q- a4 S# F, E# C* y9 S' gwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')0 |* H+ w3 b. L5 M* l) ]' d0 l$ @
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
' T+ t$ d% f# g. e$ W$ Qwrite('</ilayer>')! o' n2 N$ Q3 |
}* L1 p5 E9 i1 I
document.write('</td></table>')
+ p, O4 F9 x4 }: w# a% E& g* d}/ A- w: k( k. H# ]9 A2 u
}8 D3 K3 w# ]3 @# t0 E: ]9 t
</script>

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