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

|
网页之跑马灯文字特效
//修改宽度7 a" }+ S; o- E6 X0 \5 T
var marqueewidth=3005 ]6 g6 K' Y: Q$ [1 \
//高度( _ r) b, Z4 n5 F$ ]
var marqueeheight=25( B0 {/ j* H' b% I4 v2 g
//速度(1-10)
: c" W6 U0 S2 T9 z5 C9 j' i: g8 qvar marqueespeed=3: O8 ]) M) R5 k, v5 {, ?$ v9 i
//背景颜色! G/ B6 o2 s3 g( `$ m
var marqueebgcolor="#FFFFFF"/ Q7 f$ X! n& _" G8 C; m
//是否能暂停 (0=no. 1=yes)?
* A7 P* W' Q \var pauseit=1
% r$ N9 \6 t$ J2 c% I' i4 F' r9 m
2 p$ |; C8 Z. J2 C//修改显示内容% ~& R, }0 M0 {
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'" [7 s' |( Q9 I1 M: i# m
) u0 F- Y G2 Q
( u2 T$ H0 b% i////下面不需改变////////////
8 u3 t. e. h1 A; X2 B( z* S3 b8 v4 O
var copyspeed=marqueespeed' D8 B0 b3 Z* x* {
var pausespeed=(pauseit==0)? copyspeed: 0* J7 |7 z7 g Z% i2 ]! q
var iedom=document.all||document.getElementById( h! g, T: C8 J9 r6 V
if (iedom)
' X9 @! Q5 w5 V2 U) G. x, h- }document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
- A+ }- V& U. v4 n7 Dvar actualwidth=''
+ g. Y5 W$ z' X. i4 V* q# R, Wvar cross_marquee, ns_marquee h) t& ]' V! h) k3 i: l+ u
' l, |# D/ B* R* N# W
function populate(){4 y4 Y0 s7 {6 I( R/ p
if (iedom){
* c& k2 O# ^+ }$ R( c% z. ccross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
/ a! C( e' E. V# n/ o3 Q+ Qcross_marquee.style.left=marqueewidth+8- ?& Z6 }' B; w$ `- N
cross_marquee.innerHTML=marqueecontent, Q! k: a& r7 T" }
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth8 E) `5 m, X6 H6 g) J5 _: B* K
}8 V! l. W" u2 g7 @
else if (document.layers){
0 W: h1 g: k6 Z6 _0 X0 Vns_marquee=document.ns_marquee.document.ns_marquee2
" a2 a2 z5 {6 j/ }2 o( k1 fns_marquee.left=marqueewidth+8. A# b* h* l8 f# |1 J/ ^( O
ns_marquee.document.write(marqueecontent)$ y: ~+ K' W: v' i: b9 t' n: D
ns_marquee.document.close()7 o; o2 i/ ~3 p6 Z: [" `3 I5 z" \
actualwidth=ns_marquee.document.width
& F+ i7 q) i K}$ u6 q: z& Q T1 j% _5 Z
lefttime=setInterval("scrollmarquee()",20)5 V2 @6 S7 Y( n; B7 s& w: Y" s% n: F
}/ F5 ?9 d- |% Z9 p/ W8 a- p
window.onload=populate
8 J. u# u7 G7 S r p+ h- Q3 l% Y, l4 }* G) v* Y; j
function scrollmarquee(){
$ F- G5 i- m' }3 i- W# Eif (iedom){
5 u# ?- v: j( g* n9 ^7 T' w. L# Dif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))/ ^ j4 @, |4 }* e! J
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed' I) z4 p* M2 H. X1 ~& _
else6 B2 }$ S% W) Z6 Q i
cross_marquee.style.left=marqueewidth+8
7 f5 R' h; t: @
v( g. Z2 _( b/ ?( E}8 `4 \2 R; j7 {3 Q% r% {
else if (document.layers){6 I. Q8 |% D6 B @ M5 {8 r# A
if (ns_marquee.left>(actualwidth*(-1)+8))
3 `% U0 l# J' S3 k4 z" \. J3 Qns_marquee.left-=copyspeed
+ G) L, C3 a/ Y6 e% q% B; celse
@7 V6 ]5 z2 B& vns_marquee.left=marqueewidth+8
3 M* n, k. o/ E- M5 \* d0 f2 ~}
6 s5 w* F- K2 u5 c}) W. n3 f9 I5 K, @
, k4 J1 z+ [* d
if (iedom||document.layers){
2 A7 n! q0 T3 Z* hwith (document){
5 d% K; B! Y/ I, ~document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
@% z+ z7 f0 N8 u# Y; f: Kif (iedom){- Z! S& T; F3 h( `, j: L) c5 k
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
- Q% h2 W/ v7 s2 ywrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
8 g( {8 S# x9 @! m. v5 ?1 Ewrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
' H! r4 v' _. D' X ?! q1 O3 _3 nwrite('</div>')8 u; @$ y, K; I$ ?( t4 J0 q, z
}" O3 @) }9 p, j1 T, P% b
else if (document.layers){
8 ~" V: [8 E) @- K3 Mwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
8 z% L% x! ~! p* iwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
" R X' Q7 t owrite('</ilayer>')
+ d: O$ `5 ?4 d. ]) D' e. d}- f+ Y4 N+ v8 ^7 l- |5 x
document.write('</td></table>')
- ? c9 M+ M |; {, y}- R3 A+ c' d4 k2 `1 S
}
8 @! P( W) ^7 j* w1 V</script> |
|