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

|
网页之跑马灯文字特效
//修改宽度
3 C5 `8 t# H5 V& Kvar marqueewidth=3005 ?" [. R# Z/ O2 y R
//高度+ z. w( _8 m# Y
var marqueeheight=259 w$ f; {8 f( j& Y
//速度(1-10)% Q/ ~0 L. L6 |! n
var marqueespeed=3
X2 _5 a* _4 T; O" e3 M0 C//背景颜色
8 W a; z7 O/ p. X& }var marqueebgcolor="#FFFFFF"
' w' e& ?' L% o! z//是否能暂停 (0=no. 1=yes)?
8 i: F4 k/ F6 ?& G8 ^var pauseit=18 F* M! q. B4 M( z) x( S
. m! r) t! H# Q
//修改显示内容9 `" X& R+ v. [
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'0 o. {' l6 K3 [% E1 R i! U7 g
5 U$ |1 K/ \: b3 J3 U
7 C* T1 @( R5 j7 u u p
////下面不需改变////////////, L- |! y4 i$ a5 {! q
& p/ E p, x* D' b! L9 p
var copyspeed=marqueespeed* E8 B6 B! t j4 F6 U6 x c1 n% b
var pausespeed=(pauseit==0)? copyspeed: 04 v* a) d; \; E0 H
var iedom=document.all||document.getElementById
5 N% j7 R" b: K( T6 O0 dif (iedom)4 x: m5 v% M) a+ o. I4 X& C7 T, g
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'), V [9 p. r. j/ \
var actualwidth=''/ ^' ]" v8 q7 G( I6 `
var cross_marquee, ns_marquee
6 N$ _' k! }- @2 V$ j& P- x( i
+ }0 u$ E0 R2 J0 _1 [function populate(){) f& P5 ~9 `$ J7 l
if (iedom){6 m2 [ a; P0 O+ a2 J& H
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee2 b, h2 K5 y: D+ O( O2 P$ d
cross_marquee.style.left=marqueewidth+8
& s" Q0 S6 C$ P8 B. G1 Jcross_marquee.innerHTML=marqueecontent
0 a. h4 u- N7 i2 e, t# q A1 zactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth8 w6 X0 x, |" N1 \( A x
}1 b& F K1 Z" ~# b1 s
else if (document.layers){+ a8 L' n2 N& E8 n: X6 O; P, r8 E
ns_marquee=document.ns_marquee.document.ns_marquee2
; z& ~# `$ D! B9 D% X( ]ns_marquee.left=marqueewidth+8
* |& ]) q! s! H1 b: K0 lns_marquee.document.write(marqueecontent)
F, J0 M& i! |4 E+ P B$ m+ pns_marquee.document.close()
9 _* E1 r" ?$ B7 O G' _actualwidth=ns_marquee.document.width
3 T# K1 t. c( B, K( d: {}
' ? B/ c" R& h3 T# a& }lefttime=setInterval("scrollmarquee()",20)
1 d% ^( u: A& w}
]. D0 A! j1 {3 ]( gwindow.onload=populate% Z) o% k2 e1 L. ?, [& R# E
2 Z0 A7 Q) I& T* y1 B' P+ @
function scrollmarquee(){/ [7 p1 ?, |" }9 F$ x8 t6 {; B
if (iedom){
) a+ H: l$ k" M$ d5 Kif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)) }9 ~. G0 V: f$ J0 b9 p
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed) p8 x9 N+ m" S/ O s- Z5 W
else$ q" S: M7 E+ e8 G' u7 ]7 A; I
cross_marquee.style.left=marqueewidth+88 a2 L. V$ t% D0 {1 c2 O( j2 h
1 g1 Z, k9 f& W& u! R0 P ^3 R}& S1 Q4 d+ s/ t
else if (document.layers){
8 u5 M8 ^$ F9 \" W* ^if (ns_marquee.left>(actualwidth*(-1)+8))
: m. n& n; l/ ~6 Dns_marquee.left-=copyspeed* b( n% ~, G* k) ^9 T
else2 c* H9 y3 X7 d4 k3 i B
ns_marquee.left=marqueewidth+8. v/ z& Q* M M$ L5 ]3 {2 L: d: i
}) h# i9 F% t- W* [
}% ~' o- {2 p* N3 h# e: p! I3 e/ P6 @
2 }( i% x4 m* }# x& D8 k1 g
if (iedom||document.layers){ p6 {; I( i. Z7 ~, V
with (document){7 f0 Q) h+ V& O! c2 J
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
; X n4 I- L4 x5 Hif (iedom){
/ O) S r$ u! ?write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
9 v6 p! s& \2 V- b9 rwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')3 h2 B# Z4 B: q- O+ n8 l; h& T& Z
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
6 _! f" `% `; R! Z6 o" G) vwrite('</div>')
6 _0 u ^( L4 b) ?8 T) j}
: ^ G; w ?8 S5 p( \2 nelse if (document.layers){) I, ?4 L" H% Q, q. g- B
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
& F( o' ^7 O( d% r& vwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
! x8 ]) X4 c8 C1 C: s t4 D/ nwrite('</ilayer>')
# [5 m( `: L) X5 N+ M! P+ P}' H* _* _7 N' Q
document.write('</td></table>')$ m: W L% l1 M
}( a' R; o& I; w3 E9 d$ Y9 v V0 Z
}* T6 C) t2 e3 g: l! u
</script> |
|