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

|
网页之跑马灯文字特效
//修改宽度8 S( m# z4 G2 y; z
var marqueewidth=3007 Z& w+ o1 {8 R* A' ] F
//高度
+ e o! S% d' d' d5 s8 [var marqueeheight=25, i' X* z! W( L' R! E4 C
//速度(1-10)
8 E* n; o5 e- L- J% [var marqueespeed=3
4 o4 b; B ~( f1 P& I# W v, \: v//背景颜色
1 Z5 n! ~& p9 k; ~- p/ cvar marqueebgcolor="#FFFFFF"
& d, w: M4 @' s3 x- {//是否能暂停 (0=no. 1=yes)?
( Q! k( b9 i0 yvar pauseit=19 O4 L6 t/ p1 S+ N# i4 @& Z& f
0 I9 h5 y5 h* ^% J7 m! E6 ^//修改显示内容
5 V3 z$ s3 w+ f; }3 T+ q1 k- P0 u. ]var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'% m6 G( V; j0 O$ Q
H: z- l8 G. w/ e6 w3 }2 R3 b) D) c( l/ a
////下面不需改变////////////; q4 P4 H* [6 [7 [% `7 m
* I" p6 Y5 A4 X+ Z7 H( vvar copyspeed=marqueespeed
- N5 v( [- i% C; l! {var pausespeed=(pauseit==0)? copyspeed: 0: F* q" \2 o4 i4 o; Z K3 D
var iedom=document.all||document.getElementById" H6 q- O: j, Z8 C7 ?( M5 K" U8 \
if (iedom)9 I0 M: u' F+ I- T9 D
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
+ @# [* t% i0 |. Xvar actualwidth=''0 b( u+ a6 Z6 f* N
var cross_marquee, ns_marquee
+ u2 ?$ j2 [& Y( ]/ {" ~! z: @! g2 T" @0 s1 Y
function populate(){
( u$ W+ z7 s: C5 h$ yif (iedom){( ^* ^1 e$ |. d- ~, `
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
) d( T) Z0 C. z5 }. J R9 Ccross_marquee.style.left=marqueewidth+8# _' U* N% S* H1 G8 T3 h. I: v
cross_marquee.innerHTML=marqueecontent
; L, ~' `' w9 f" Y. Kactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth! R# n' c. V3 S& ~/ k0 p2 ]
}- s. X) f* _7 C1 E6 p8 k' L
else if (document.layers){8 _# J0 _; I$ J! e% |. h
ns_marquee=document.ns_marquee.document.ns_marquee2
8 O1 y0 w+ H, T6 Z/ X: v* gns_marquee.left=marqueewidth+8
- Q8 L9 R- a# S1 z2 Tns_marquee.document.write(marqueecontent)
( }8 r4 b* m5 j6 \: g6 d' d" v5 Hns_marquee.document.close()
- f- \, A+ m1 L5 D l; factualwidth=ns_marquee.document.width; V$ y) ]# m6 J. R" U5 [9 f
}
% o1 H) X% f# _* d9 qlefttime=setInterval("scrollmarquee()",20)( u1 `" @7 s' W
}
]% L9 A7 ^/ @9 X( r. A# gwindow.onload=populate5 z- G' u, n8 P6 \' A- ^' P, }2 P2 t
3 L! m" G/ t3 U$ ^3 u6 H
function scrollmarquee(){% M8 Y5 a( u2 G W
if (iedom){+ L0 [& z7 M. J& w
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))' }( ^# y0 _' A
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
& Q$ C6 W* P' g' A' velse- P5 n- _, u+ W1 ]& k0 t. p+ f
cross_marquee.style.left=marqueewidth+8
* x6 G5 d6 S* S: U& X
6 ^, a& {6 p' Y$ g+ H" N1 C}8 f# J9 w+ L5 j( n: X6 d) O
else if (document.layers){
2 M& G2 f4 d% Y y6 R9 H6 ?if (ns_marquee.left>(actualwidth*(-1)+8))% k! Y# e5 t" z) W n9 t
ns_marquee.left-=copyspeed
% s+ v5 z6 d/ lelse( ~- Y6 U2 Y( m& p% R* ?) p
ns_marquee.left=marqueewidth+87 ^. C9 @! \2 b' ?
}% _ D3 c) X) B. s, a7 ~! }& ^
}
2 u3 M! e; O$ t- r' K/ s, g5 F) c7 G, x8 z9 D! k
if (iedom||document.layers){# |; j( i \; @
with (document){
1 G6 s& K/ K+ O) O) ?4 m, Ldocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
' n+ C# y- m$ c7 \! x6 J9 lif (iedom){5 {/ d, x3 t4 O1 b, e
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
# G! W, t7 V3 f# Uwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')1 E/ v, |( U* l: A- l
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
" n, X* J9 t- G3 m; R W$ Swrite('</div>')
" m) G7 u7 x, z9 L6 t5 D}
( k5 S9 b _6 velse if (document.layers){# j# V' w4 J8 `
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')/ o" q7 H8 ~. B: B4 D. Y
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
1 w4 J- @' q |write('</ilayer>')
4 e" X5 |% i& ]: e}8 l/ L8 O. [( c3 P+ }7 C
document.write('</td></table>')
; k* Q# s$ i2 Y2 t: e}
8 D. Z M) k H1 D5 h) F2 o; E: N}( q/ c& J8 o! P4 k9 R; f: K
</script> |
|