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

|
网页之跑马灯文字特效
//修改宽度
4 O7 j8 s3 C3 d- V; Avar marqueewidth=3008 d* E8 h# k' W. W& a
//高度/ q, T8 H& o+ V- j4 A: G C% Y
var marqueeheight=25
' c @) ]( d. o//速度(1-10)
5 a" d/ w1 F9 s8 W0 k, f5 M$ Nvar marqueespeed=3- C( i: w% u" w8 V
//背景颜色
6 V2 Q; { t1 Vvar marqueebgcolor="#FFFFFF"
; I# C! M) V7 K* I//是否能暂停 (0=no. 1=yes)?
! i; x% l: h( q; T0 P" m. tvar pauseit=1) K# G! @+ {' M) i& K" ~* i3 h0 J
& C3 G# ^4 @& M' z5 ?8 r7 T# o//修改显示内容$ t. A% f ]* t% Y4 X
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
3 X) h" D x0 Y$ G2 y+ i, ~% r: M. t, B4 u( G
1 ?6 H4 n' I: q9 Q P( V& X
////下面不需改变////////////$ }* f% }. B6 F" D1 _- h0 v
% H$ w1 ?( {& v( u, s
var copyspeed=marqueespeed8 ]" y( z: W" r3 A# o
var pausespeed=(pauseit==0)? copyspeed: 0
\* n- c i2 M* vvar iedom=document.all||document.getElementById
3 Z1 ~7 l. R5 v0 m. ~if (iedom)( \# H- b L* y( y$ @/ u
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')5 O' G" c8 p' [0 V
var actualwidth=''% n# d! J. U$ ^, \4 ^+ |+ _- J0 c
var cross_marquee, ns_marquee
3 z W6 d" Y3 H3 ^
! u. ]+ N: W- p( Q3 `4 kfunction populate(){8 D" B8 i- G! ]$ ~- B* W8 J
if (iedom){
0 v. t) g% R- K; zcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee# f& [! b" [! T5 F
cross_marquee.style.left=marqueewidth+8/ f5 ^6 B$ h6 G& y( c
cross_marquee.innerHTML=marqueecontent
+ H& k5 ~4 n, ~+ B) Nactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth- D |3 o( y4 o3 i5 R/ A: K
}3 i' Y. C& F" Z. g r! W# l" Z* A0 M
else if (document.layers){; a2 ]2 X! C3 }' f8 {- x
ns_marquee=document.ns_marquee.document.ns_marquee2+ w9 G9 c9 c+ K+ d5 D/ v% P
ns_marquee.left=marqueewidth+87 e" P n0 ]2 \' z/ [9 f0 c
ns_marquee.document.write(marqueecontent)
/ w) R4 b8 o: ^5 F9 bns_marquee.document.close()
1 Q( z9 }2 t6 \ l3 Eactualwidth=ns_marquee.document.width
; ^1 g @$ E0 U5 h& x}
t) G% N% s' r2 b3 Plefttime=setInterval("scrollmarquee()",20) e4 g. D6 R9 m4 z6 J
}
0 r& U% `( a' [" G. gwindow.onload=populate
' r, ~ R- ~3 G- H7 ~0 t" c4 k8 M R, [" }3 J7 O
function scrollmarquee(){
& W1 y; y. m, s# Eif (iedom){
0 p; B, t: \' [if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))3 y/ D" u* H. [! R
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
4 @3 s0 w1 L" g$ t/ o xelse& u7 u4 a0 L6 w6 w
cross_marquee.style.left=marqueewidth+86 F" A7 s$ F& n4 [6 y5 n) K- K1 _
c2 \! g( _- J6 Q1 k
}: `- ]& n4 w" ?7 d0 X' G- p" D
else if (document.layers){+ t! {( `$ | N/ n v
if (ns_marquee.left>(actualwidth*(-1)+8))
& C4 y! b" z2 v8 Z+ |ns_marquee.left-=copyspeed
, m9 s$ G1 Y& \( Z/ u* _& Eelse
/ p+ Y% }# [: M) K' m( F1 O7 qns_marquee.left=marqueewidth+8- ^7 B7 L1 T q
}
9 O/ f1 X: I& h+ c}, Y9 P- Q7 W; n% g6 K: }; m2 H. k( H
/ t! B$ k1 U+ m, J1 c
if (iedom||document.layers){- v( \+ F" ]/ I$ v8 V" u1 a
with (document){4 W0 Y2 p' P( o H
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')2 U' E" v# P! E7 E2 Y
if (iedom){. m3 Z. |) V+ [( q
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')8 E& p6 E2 |5 s/ |4 a
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
% n j. I) A7 g' F6 Ewrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 w9 p9 T4 M4 H7 j/ fwrite('</div>')
; T( |" D1 o# r}
. V8 e9 ~* q2 ^$ @else if (document.layers){ |6 I! F$ u; F' j; O
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
- B# }' w9 h }9 D) K/ Fwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>') L2 s U0 K' y' I
write('</ilayer>')8 ?1 h& N/ f% ?; g1 P& e7 Q, Z/ A
}1 g6 ~: e3 D2 N" M X% V' p
document.write('</td></table>')
6 `1 k0 L% { X# a1 O+ {2 j}* t0 E# N( N' V: @
}
3 N' G5 {( o/ A$ F$ n7 [ P</script> |
|