返回列表 发帖

网页之跑马灯文字特效

//修改宽度
0 K; d3 i  H8 d3 e/ [, Vvar marqueewidth=3004 s2 f/ ~. P( x& u
//高度( \0 I* c& k* ]
var marqueeheight=252 O& j) j! u* `! y. w
//速度(1-10)
5 \- o) Q( T  l0 s2 [var marqueespeed=3
6 f, n$ o; r5 Z# s//背景颜色
) ]3 K, h; I) vvar marqueebgcolor="#FFFFFF"
+ ]3 f. z3 N1 r//是否能暂停 (0=no. 1=yes)?! `/ }6 J& n$ k& j9 p+ }# H1 `
var pauseit=1
( L7 {: h) b+ B& u8 l) ?+ W0 S
//修改显示内容' E+ E3 M- G: S/ S$ P* j2 r
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'$ K: S7 g4 z( x, P! l9 Z8 ~- j
; N) k$ L, ~9 z+ z- _( D. B
3 x2 I# w7 m/ q1 M
////下面不需改变////////////  R4 y: v/ D% a" V. C: _" N

. L* Z2 l0 i3 o# f; i' |  ?/ `var copyspeed=marqueespeed
0 E' n- g6 P& I& \- {2 ~, G. Mvar pausespeed=(pauseit==0)? copyspeed: 0
. s/ S: M7 l4 ^3 f' [var iedom=document.all||document.getElementById, z) ~$ b3 z* B! _: K: j* i1 I6 c
if (iedom)
5 d* Q4 l' Y- I! R2 tdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')- t9 J7 L7 i( ~: x4 ?  D. {
var actualwidth=''
1 r( O5 Z% B0 F% G0 P( m& rvar cross_marquee, ns_marquee
. T/ d/ n& i9 b! [1 F4 G, a& O7 y" m0 ]- u$ \2 N5 i$ q
function populate(){
1 @( H: j0 v2 i) ^8 i9 q, qif (iedom){
/ P# @& k! ~( `6 M  D' K6 Hcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
' C2 t  O7 y& P, Icross_marquee.style.left=marqueewidth+8
+ @- t! H, }  U8 C1 L, h( Qcross_marquee.innerHTML=marqueecontent
0 P6 V- ~; x6 M2 Q* Pactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
/ ]! M7 p4 y. a  {* V# \' z}: J( ~) u# a; f- h6 b% G
else if (document.layers){4 A5 ~7 _- ~+ h2 {- j
ns_marquee=document.ns_marquee.document.ns_marquee2$ l8 z% e7 W5 H& d6 S$ O
ns_marquee.left=marqueewidth+8
  d$ l7 z+ x' c5 [- `2 @4 u% wns_marquee.document.write(marqueecontent)
3 o( ]! X/ R; Ans_marquee.document.close()* Q/ ^5 i( l) T
actualwidth=ns_marquee.document.width* x4 Y( g3 x* @. z" k: |5 P: t+ f# `
}- [) s6 n1 [8 ?6 t) j: G  l
lefttime=setInterval("scrollmarquee()",20)/ X  D, A9 F/ \9 ^$ v; [
}
2 ~( D( |7 H: v# b- K3 e9 g1 z- \9 Zwindow.onload=populate+ l4 E) n. D9 L. ]
& u1 G# z+ L0 d
function scrollmarquee(){
4 S8 U: p4 i, A4 oif (iedom){& U& U+ [7 x; b$ g
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))- Z( c7 m- B- ^
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
" R9 S) A/ y9 t) Z8 C) e- U0 ~5 Kelse$ F! o* I  }* _5 \& i* R, ]
cross_marquee.style.left=marqueewidth+8
( S0 p5 n7 o! Q
" s* y- S; Y# d& k; V}& B) ]! p  ]0 u- `7 i8 e, V; M
else if (document.layers){
: ?7 \$ x; v1 z( f0 I1 Eif (ns_marquee.left>(actualwidth*(-1)+8))
0 B& G* M% Z& g* Z* |' vns_marquee.left-=copyspeed! o1 ~2 Q+ ~% z: U0 a' {5 F6 ^
else' o8 V$ X: E" w; w5 l
ns_marquee.left=marqueewidth+84 |# \0 j8 T& P: O  V% W' p0 |- y
}
9 K' X- g9 d# f+ b, k}
3 g0 S- |) E8 o; C/ ^2 K9 @
3 y1 P4 R4 q: f, ^if (iedom||document.layers){" k* v, B* A/ H+ c2 o
with (document){6 {: v8 n2 ~( M2 b9 X( }0 w
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
9 i4 T+ X. X% Y/ U* ~  @6 c" P- kif (iedom){6 @2 y2 G9 \2 ?, s* r
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
8 S9 {. `8 g8 X& d3 }! a& V" Ewrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
  g" k( |" w8 c- x- swrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
5 H9 U0 v' Y9 L( o- x; G6 Fwrite('</div>')" v8 [3 |1 `6 f
}; w% C  o2 e4 I6 ~
else if (document.layers){# Y1 E4 L/ K6 ~
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>'); B5 g7 q( L, [3 ]
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
7 W$ l# Z7 u' g% m3 m) \: Xwrite('</ilayer>')5 n( V2 q' M3 r4 B+ ~
}8 q# c. [. U1 i$ U
document.write('</td></table>'); Z9 s) Q! R) h, \2 D
}
9 o5 V0 y0 n) x0 k& o8 \- _}
+ ?; q7 H) s, \  i</script>

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