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

|
网页之跑马灯文字特效
//修改宽度
$ y9 k3 j8 q5 N+ h! N l' Kvar marqueewidth=300& b& A4 J! B; ^: S# J8 q
//高度3 Q$ y. q$ d; r/ s: R# r
var marqueeheight=25
$ }" r# r6 d1 g2 Z) I. R( j//速度(1-10)3 d+ ]8 F- K- ]( c8 W7 V
var marqueespeed=3# G+ K3 ]9 w4 x2 Q6 t7 g1 p; W
//背景颜色' n2 V5 ^8 T" X9 w6 z; H, l' n( r
var marqueebgcolor="#FFFFFF"
8 g3 _1 }2 ~) s//是否能暂停 (0=no. 1=yes)?4 B' {, B# R+ o: j2 ?0 V. h
var pauseit=1
+ x; I" U9 R1 @3 w. A
/ w" R0 y4 s% O& J. _ `! o) z; X//修改显示内容3 C+ I# q& L4 g7 ^6 o3 _1 W" N8 K
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
( ?8 z2 B: ~" r7 a5 w6 i
7 w4 }# Y, z, p7 M
, e% T- I) ~/ l, z a) l////下面不需改变////////////
/ i+ d: d$ d: S6 Q: K# s
# \& U8 c7 X5 e2 K( s) {1 bvar copyspeed=marqueespeed
- e0 _6 t7 l% _; b3 Z; `5 m/ p6 }var pausespeed=(pauseit==0)? copyspeed: 0
" Q1 y0 y( |; Y# Zvar iedom=document.all||document.getElementById
8 e) f1 b# [! D; n1 ?if (iedom)
1 x1 u+ o0 d$ X) {. ]" a7 L* bdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')# \6 {! |" M7 o! }6 C
var actualwidth=''
4 X H5 A* u5 H5 F2 @var cross_marquee, ns_marquee0 F2 h8 q* F# |# z
7 K: ]- n6 h9 l) \
function populate(){
, |$ X" f- J9 f9 p! H3 k0 Q' Q0 Tif (iedom){
& e& @/ ^1 ^8 z% K* V9 j5 n% l; Y( Ucross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee- A+ P8 I9 C# j8 {: } w
cross_marquee.style.left=marqueewidth+8% E& W9 E( ~5 P- k+ }
cross_marquee.innerHTML=marqueecontent" h4 P( u" I' |- \' @: h& x
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
* Y+ ^; B/ t, D* g7 D8 G, }' `}' p% E# |# Z. g$ }
else if (document.layers){$ S5 I. ~5 R8 k2 Z$ b
ns_marquee=document.ns_marquee.document.ns_marquee2
0 A8 a& F+ D* w! ~. o! nns_marquee.left=marqueewidth+8! N- A2 O6 U* V7 v
ns_marquee.document.write(marqueecontent)2 Y0 [) P6 t" c% L
ns_marquee.document.close()4 W/ ?+ p7 k# G! X/ s! m- u
actualwidth=ns_marquee.document.width& o$ Q: V# v9 v/ _) c7 Q
}
4 x9 K* K5 h3 o9 S! p, dlefttime=setInterval("scrollmarquee()",20)
1 a9 [* j, d& t N; a0 p+ p}
/ |8 P( N, f5 v6 J8 x( f5 J: Ewindow.onload=populate
$ c D' l! h. G- ?
2 z P9 R( E7 F1 ufunction scrollmarquee(){, p1 w3 P4 P% g! X6 T! [; \6 ]
if (iedom){
3 n3 u* W. A, u2 L; i2 `if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
0 b+ j8 r8 V1 P0 Y8 \: pcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed2 p' Y: e( W" C, P
else2 k5 E4 u T/ K
cross_marquee.style.left=marqueewidth+8* s3 ~ R& N2 s4 ]% V
2 C0 S S4 t4 x0 d) g}" s& j; w5 R/ S8 _( { K
else if (document.layers){
& U5 a/ s/ v) |; w- M5 b# H3 Zif (ns_marquee.left>(actualwidth*(-1)+8))
1 P9 b& H7 D, |7 K% o" F( r6 ^& n: jns_marquee.left-=copyspeed$ [# f+ p p" f$ e( T
else
! H! o. Y6 e3 t; P( p$ ins_marquee.left=marqueewidth+8; D3 h: ?' h; X. \: o8 R! `
}" y8 J3 x' H8 N
}/ b* a& r- O+ A# K
! m1 O1 s% g: M4 T, m* L0 g% M% y+ V
if (iedom||document.layers){
7 S' y0 G9 d, K; d1 w zwith (document){4 ?9 M6 }. K' s" c) g3 R6 C) t
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')& }4 g8 t% [: p: D& G: K7 \
if (iedom){
5 Q/ y; J+ v% G, [write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
7 K6 O: O) L1 T% L; \; owrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')+ _ b6 i B* |7 E$ i, l
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')' \+ A. s; [5 h
write('</div>')
# T- u/ p! k3 ~# D' S1 r}1 R) n2 C& k! }# r
else if (document.layers){0 o& h- f1 q5 A% \
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')+ U4 k( o/ Y+ O- l4 d& y+ V `
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')# d1 D. ~7 Z$ A. T
write('</ilayer>')
5 q7 D0 J# b2 Z8 [1 i}- B* c5 N* x. Q7 |
document.write('</td></table>')7 x/ u) l, N0 M8 s$ {
}: P7 e4 U6 e( C0 b0 S
}
6 Q8 W4 `) }/ w3 O( Z; I</script> |
|