获得本站免费赞助空间请点这里
返回列表 发帖

网页之跑马灯文字特效

//修改宽度% I% s% ]9 w+ G3 R
var marqueewidth=300
1 w% x4 K8 N' ^( N4 F//高度  `6 `: l$ }5 G2 H; u0 R. n# n: n6 Q
var marqueeheight=25* u, Y% u. v9 O3 z
//速度(1-10)
) I% }" K2 Z8 c$ Lvar marqueespeed=3' l9 d1 z+ o5 ]2 ]  P( R6 o) i3 i
//背景颜色0 u4 ?$ T' E: f2 [& t
var marqueebgcolor="#FFFFFF"; }" V+ r( v4 w" g: C: `
//是否能暂停 (0=no. 1=yes)?
9 R* Q5 W! ]: M2 u9 L$ Kvar pauseit=1
/ D8 j5 ]  j: {! U
+ \+ l9 d6 \: ]3 n  ]# b. V1 F//修改显示内容6 k% k$ Q; r! E& b& N7 {4 y  {# n
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'0 M. k! z& J# l* b( n5 y

5 L+ l! ?9 ~! |: ~. C% Y2 g- C0 s4 ~. Z- S
////下面不需改变////////////
* i  G# R% h. M1 v, Q. i9 L* h
5 p1 k: Q' G( W. h( c, nvar copyspeed=marqueespeed' Q# a6 r( u0 s2 p* h# u
var pausespeed=(pauseit==0)? copyspeed: 0
. {0 O% _+ {6 m; B0 I+ Evar iedom=document.all||document.getElementById& u& V% K1 o8 {$ g& \( M
if (iedom)# _8 F% y" h7 \% m  j7 M$ S
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
3 j, h. A/ I9 i5 P+ W; Z4 x3 {var actualwidth=''3 W- l9 u6 z& D' s9 d5 a
var cross_marquee, ns_marquee
4 S( H( X1 V! C$ k9 Q- P
+ F# N+ o# [1 x8 P5 E7 zfunction populate(){
* h( N6 W7 o9 U) Bif (iedom){
2 R5 K4 ~4 E3 |0 l+ O1 a( V2 Tcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
; e, q  i% e7 m+ i3 W5 Tcross_marquee.style.left=marqueewidth+8
9 j+ `) Z& I( G; Z; t* ~cross_marquee.innerHTML=marqueecontent  z; x/ [: J, o, P1 ~8 E2 c" t
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
3 l: Q6 k: ]- _% }  ~}3 `' V3 Y- ~, o( U3 a
else if (document.layers){
3 s. X( h% r4 s' M$ N! Tns_marquee=document.ns_marquee.document.ns_marquee2
3 g5 |4 z9 ?7 I& yns_marquee.left=marqueewidth+86 @- D, R$ p- ~- {+ z
ns_marquee.document.write(marqueecontent)
: z" u& u  q$ U* a& T+ Bns_marquee.document.close()1 J& e! {0 s. i; K
actualwidth=ns_marquee.document.width( J: e7 k% p9 z1 S! X1 C3 G
}0 {! U0 D8 L4 g0 ~2 U" @' c! U
lefttime=setInterval("scrollmarquee()",20)) ?6 M  b3 T4 f/ P+ s1 c( Q
}
) l  u$ |& @$ x  {window.onload=populate
+ y5 c( a/ ?! u1 _5 M. [1 d. M! {2 k2 K9 o7 Y/ g/ l% t& D; [
function scrollmarquee(){1 R9 E: U7 u7 t- o
if (iedom){
9 y' b1 u' U- G; w1 l8 aif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))- i1 ]1 Q9 |% E& y+ j( U# t
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed" B( z+ \! d' ~; P1 q. y# n
else
$ v; n5 o! G7 w  n% R. f% jcross_marquee.style.left=marqueewidth+8/ V7 T  \9 s- A; Q0 @& O5 u

! C6 \* L: ^3 q/ `}
1 }. T  {% v4 w. S& ?else if (document.layers){
0 k+ ^) ?3 t8 @$ C6 j5 F/ rif (ns_marquee.left>(actualwidth*(-1)+8))
$ X0 M, o, d; S5 Z/ ens_marquee.left-=copyspeed
: Z  t% j5 v1 }# D: }) n8 P2 Pelse* o; k/ i" }1 T/ a/ t
ns_marquee.left=marqueewidth+8
6 E) h+ n0 r4 s( _7 @}5 R- S% E9 [  v5 N, j
}2 _( [& Q1 T8 x7 x6 D
- Q& O3 R' n& ?+ J# g) f6 y# e
if (iedom||document.layers){- p8 P  z3 V- V5 N( O8 Q' o" F
with (document){. y( I- I% J* I
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>'). `. |2 `6 b  A: B4 W" _
if (iedom){
3 g+ y5 x: i7 I9 |2 ]- e6 S' Wwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')5 E. j' {7 [" i/ u, C4 l
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')4 u/ ~- Q3 L9 ^' h1 P/ G
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')0 N. z' V; [) c0 H8 n+ p' {
write('</div>')' {; R. x; n  K% x5 L8 `8 K
}
3 J) H( c$ g; J1 kelse if (document.layers){
$ S1 f. K) m5 ^2 J+ {write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')- j: e6 R! \: m9 p
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
, `8 l1 s. a. Cwrite('</ilayer>')
3 E( R( t6 g7 }3 x, @}
! w  _9 t3 U* g& vdocument.write('</td></table>')
0 Y7 \! Z/ r; S- r1 b}0 j2 U" P) G" d: [* y
}6 L  h2 N1 l& k) @# z  F1 U  B5 U- h
</script>

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