|
  
- UID
- 133
- 帖子
- 51
- 精华
- 1
- 积分
- 186
- 金币
- 55
- 威望
- 2
- 贡献
- 0

|
网页之跑马灯文字特效
//修改宽度8 z4 k4 l Y0 _) Z5 ?
var marqueewidth=3007 o* l6 }+ h% T4 y
//高度
, `3 E- |8 o4 H4 H {var marqueeheight=25
+ t. ~" |$ \# I8 l//速度(1-10)
% |1 `. D( l A+ x- Z Avar marqueespeed=32 e. w% C2 m, w! a9 u
//背景颜色
6 a3 j: W) @- _( C( Svar marqueebgcolor="#FFFFFF", j& i# \+ I6 q& {8 ?8 g6 j2 m7 ^
//是否能暂停 (0=no. 1=yes)?: T* F* U. |) p& \
var pauseit=1
8 z- k' u2 r0 o
# k U5 [, N7 ]3 S/ S. x//修改显示内容
7 Z$ `! s8 k ~, y* gvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'" Y6 A, m9 ^( O3 {- v* {
) Y( h, m0 f; u
6 N% S4 i3 r) o. z, @( w
////下面不需改变////////////
& A# q# d$ q2 o+ P2 M2 L. r( H( |" s% i8 d3 X1 G
var copyspeed=marqueespeed* L# r2 Y+ J' e* T1 k0 I& \, \
var pausespeed=(pauseit==0)? copyspeed: 09 \1 j& V2 W- z" V. o. t
var iedom=document.all||document.getElementById
' M6 E, a! X9 f5 ?" |" b6 F7 oif (iedom)! n% a( V8 E, F0 ^% N- \3 y/ \
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
* P% n' n' O6 K; L% H9 v. ~var actualwidth=''
s) J8 Q6 B, o/ v, e2 \, \var cross_marquee, ns_marquee
# T6 q' x( ^9 ~/ m" S: Q$ ]3 L1 ^
function populate(){) M/ C4 L! o" J6 `1 a
if (iedom){" \% s3 x" {) ~1 D1 {
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee* {' K, n. n5 ?: O! [7 Y6 j) L
cross_marquee.style.left=marqueewidth+80 n% X7 c* n& Z c: u( I' @+ T+ S1 u+ }
cross_marquee.innerHTML=marqueecontent( o; M$ j4 _6 h0 F" [. e
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth2 L. `" h! V1 E& G7 F
}1 z. H X2 B6 D0 L. j
else if (document.layers){
+ ^' c8 J7 R$ R7 U- x" B2 tns_marquee=document.ns_marquee.document.ns_marquee2& j- {" J) q5 {7 m$ {9 \+ [# `2 d
ns_marquee.left=marqueewidth+8
% M. Q5 R% A& C: a/ }* h. b) Hns_marquee.document.write(marqueecontent)
4 H& d) E( l, M/ d5 O( d! h+ ^! {ns_marquee.document.close()
9 e" Z& D' k# s% P0 Q- K1 sactualwidth=ns_marquee.document.width
( ] H, W5 P3 A/ ]' `' C' X}% ?& z& T6 @ F1 V+ y" b
lefttime=setInterval("scrollmarquee()",20)) q& D) L# [ F2 ?. ?. u' b
}! J( z$ c$ k2 Y# J
window.onload=populate
% c: S' _+ i9 O
( t8 ?6 ?' i9 W- Ofunction scrollmarquee(){8 ^: r9 i2 |) b
if (iedom){
. |& M. ^+ _. F' y$ Y) Z7 lif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
( K* A" w* V; W2 P, I/ jcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed( n0 y4 `6 U& r+ x" t* q z4 Z
else
" r+ Q$ A* n/ v, kcross_marquee.style.left=marqueewidth+8 A" i; u5 h. N* N3 G
6 x2 T5 f$ K0 E# O
}
0 }# K; [- I& m; ~( P( ~else if (document.layers){
7 a) f, p2 y0 K7 C7 U' ?if (ns_marquee.left>(actualwidth*(-1)+8)): t: U. I1 C+ Z5 ^. ^
ns_marquee.left-=copyspeed
/ M. k! P% ^2 q4 I& Uelse# d. n1 e3 l+ q e' N/ _/ a6 d
ns_marquee.left=marqueewidth+8
6 T) i9 p2 h" j" Q& O}
1 u1 z6 K7 b, d' a; ^}! g7 e4 M) `8 I# K, _7 `
. m& z, W4 I* A) ^" e, Rif (iedom||document.layers){( r2 E8 [! t+ y$ }, L
with (document){1 }, _0 G' U8 c& N
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')1 r) n- J9 A4 p) M5 }, p0 T
if (iedom){, Z6 H4 K% i& U A7 }
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'); w2 z- g/ y6 U9 ^
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
3 C9 r* s: K$ J9 c/ H" V4 p2 G, vwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')$ t9 y9 T0 p& ?' B9 W/ G( J6 }
write('</div>')' ^- w+ [/ c; y7 a2 D
}9 y8 _0 y$ ^* ~# S' K/ s
else if (document.layers){' C" J; e) J* o& P5 f
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')% p# T! i; M5 G) C. G* ~4 _9 j
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')! X1 ]( x# ]! `6 _7 r2 ~
write('</ilayer>')
, A) W4 U3 R% v8 S2 r}+ |: E5 n9 f7 {5 W! c
document.write('</td></table>')9 w5 T. r" {0 X% r) }) Y
}
( q6 y! Y5 {6 x# n W}, M7 n, z- p/ J' B8 s+ I2 U" J5 B
</script> |
|