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

|
网页之跑马灯文字特效
//修改宽度
3 ~$ ]; [0 a" c" P$ _" M% lvar marqueewidth=300
c1 M% q( C; s9 K, d0 f: v" R//高度4 e! } n: |9 Z
var marqueeheight=25! t, e' k. _8 _' s$ Y) {& b
//速度(1-10)/ ?$ S3 ^; i- G- z
var marqueespeed=3+ ^( T5 G, A7 @/ v ~2 z9 ~
//背景颜色2 N; A+ t/ t3 n0 I* b; Y
var marqueebgcolor="#FFFFFF"
% l0 {6 p" Z1 ?& D. n' w//是否能暂停 (0=no. 1=yes)?
* G& y x7 S# j' V( f0 Tvar pauseit=13 R: f+ R" z. a7 b
2 ]1 M1 k5 ?7 b9 {% c7 ?0 N0 u
//修改显示内容
0 f8 S3 [( A1 W8 M9 Q; y% l" |var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
/ N9 ^+ L3 h& u: p- ?# }- t5 {
+ {+ }2 I! `4 n. d) A; }0 f
/ J# M! J+ I0 I5 U3 d: W////下面不需改变////////////0 h$ ]4 h. j5 }5 y- ~
7 J0 h) c% j. J! J: X( u% Z& Vvar copyspeed=marqueespeed
8 ]! E* \ z8 c Z hvar pausespeed=(pauseit==0)? copyspeed: 0
2 H4 p4 _+ r i% ?1 c$ k+ Hvar iedom=document.all||document.getElementById( [) q/ }9 h9 ]. z8 y
if (iedom)* N# b" N6 e! M
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')0 U; B! b! N; f( N' f3 G: U7 [# s
var actualwidth='') M5 ~& g! Q4 E3 J! L; |
var cross_marquee, ns_marquee/ E2 o, Y) D$ ?% e& x
# n b* K a' `9 d5 Q# n$ L( F Cfunction populate(){
' T! N, Y, S Z9 G1 B+ R' Kif (iedom){
' H( |% L7 }- b1 e) m8 | w# fcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
; }6 W& n& N: X7 R" Ocross_marquee.style.left=marqueewidth+8
]' J+ f- w) B. m8 across_marquee.innerHTML=marqueecontent
! m: g/ Z0 b. z7 F( factualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth/ W$ m' M* C% U$ c! V
}
& z0 K2 h; ?( U/ X$ I" h5 W; @else if (document.layers){
. S# c2 ^8 D. s& M5 sns_marquee=document.ns_marquee.document.ns_marquee2
+ z7 g3 Y3 s6 H6 w$ Q% Z% j9 `ns_marquee.left=marqueewidth+8
4 [! M' O' m: ]# m! H7 [0 }. ^6 vns_marquee.document.write(marqueecontent)
[/ M4 J2 y& W+ `ns_marquee.document.close()/ n& r2 `8 i2 P6 \/ m3 Q; t
actualwidth=ns_marquee.document.width1 h/ V, w8 Z9 a: q+ D2 a
}9 _) Z) } @% p# T
lefttime=setInterval("scrollmarquee()",20)* U* K8 X2 h* F Z) e; l( d6 V
}6 u8 @) O9 ^& R" t; P
window.onload=populate; a5 Z. f/ e# h% I
1 f9 P) u+ w8 I' B" g0 c4 v. I6 D; hfunction scrollmarquee(){* L* P- q# N, z, X' Q/ \
if (iedom){" V; n5 P1 k8 ~ T" T1 y3 i
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
+ \2 d& m8 z: V/ H5 M- icross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
% R9 v+ k& U' Welse
9 F @. {! `' ^" U# ]% Q1 Rcross_marquee.style.left=marqueewidth+8$ d7 \3 K1 B H4 {7 j0 _ W4 P Z _
) ~# T7 S. Q3 v: H+ w" G/ @}0 L1 x$ G" |$ b4 I4 }
else if (document.layers){
# a4 V; [" h- Hif (ns_marquee.left>(actualwidth*(-1)+8))* w: ]* E4 U3 g6 z: s K
ns_marquee.left-=copyspeed* }# ?, K8 F3 ~( A( |4 B% l8 i
else' X/ g9 y* F* Z) R6 ^( E, ? r% p# |
ns_marquee.left=marqueewidth+84 Y8 |% ?& E$ p
}
3 m' Q/ s0 J) O}6 X; f: B* s# J
. p7 A* c1 H4 p% S0 s" y! qif (iedom||document.layers){* i" r( J9 o) Y2 L/ R; y2 ]0 K
with (document){6 \7 A: h& f3 h0 l9 }
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
0 V6 L9 S3 H! vif (iedom){
# B- N- ?8 M' Q! z2 D# @7 |write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
' s6 Z" s- O: F& D' cwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')( D. }% S7 i: {+ K
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
2 K7 c6 j$ \4 r6 I% a5 ~+ O; a" qwrite('</div>')
& m8 y4 b: U/ T6 j' |2 I}
8 r" l$ k `( e. X# E( `2 Helse if (document.layers){
* A6 Y3 G% U7 \0 m; l- Fwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
6 l( R- H( s! f8 N$ {3 Zwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')3 F; r- r: V% v% X
write('</ilayer>')' q0 Q9 a* L/ G9 h0 w6 e
}7 F8 O0 X* N3 O' j. T* H$ Z
document.write('</td></table>')
- h# q' G* ? S3 E$ c3 s}
1 n9 T/ T! P. N( J2 R}
/ @9 ]5 e5 k8 D H- n3 @ p</script> |
|