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

|
网页之跑马灯文字特效
//修改宽度 N2 s" G0 W3 g7 H" X
var marqueewidth=300+ B/ ], w, o% f
//高度
1 w5 \4 n5 E$ p9 j& W9 Z; }; S! ^var marqueeheight=25
, p5 R: w* X: }! C//速度(1-10)+ `$ d1 M/ }1 J& i2 I$ \4 Y) w0 Q) v
var marqueespeed=3
, ^: H! \* M. X0 }9 W1 {5 ~ X [//背景颜色1 V7 |2 c, [$ B; c' `+ r. x5 {
var marqueebgcolor="#FFFFFF"
5 {0 Q+ \5 R O+ J: s+ ]//是否能暂停 (0=no. 1=yes)?3 Y. B" i. J' n0 l/ ~, w, C/ x- ?/ [
var pauseit=18 k' y5 F' u3 k, k- x' ^4 X
/ z" p& }; Z" A8 `" @, ~
//修改显示内容& b4 ~- j1 p2 K2 \0 S# n! t" k; j" U
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
2 S+ \7 {" v4 Z8 S# Z
$ X! I3 j; r% I
/ N. C- z8 i: m, l. w////下面不需改变////////////
% H0 } A1 M* _ k' a
# U/ q0 ~/ A) `# j0 y+ pvar copyspeed=marqueespeed4 D/ f# t0 G8 g& R
var pausespeed=(pauseit==0)? copyspeed: 0
+ j4 `8 G6 D! L; L5 avar iedom=document.all||document.getElementById
& s% F9 K. v( F; Vif (iedom)
) D( [7 l: z' ]6 G2 fdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')* R8 q8 W1 A( v0 I5 I
var actualwidth=''
" y" x6 Y+ A% |/ j# ]& l; p! L0 Cvar cross_marquee, ns_marquee
( x3 [/ y6 D' J
+ L) G6 S$ A4 a2 gfunction populate(){- {9 I; F: I, S1 |. W9 n
if (iedom){
! v( A1 D" T$ y. Bcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
0 ~( K6 W- J5 L# J" Ucross_marquee.style.left=marqueewidth+8
& n$ h% c% k. i/ b, tcross_marquee.innerHTML=marqueecontent: u B9 C, n/ t' C
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
3 G ~: h0 Q" B& t2 b}
, ]+ T+ v- \9 x6 H2 I( m; ?3 yelse if (document.layers){" b8 Q, F# T0 V- q& @4 `, d
ns_marquee=document.ns_marquee.document.ns_marquee2
( x# c$ E% S7 x+ l, H, x" c" Wns_marquee.left=marqueewidth+83 t# | r2 ]" i
ns_marquee.document.write(marqueecontent). O1 d; O, ]8 x- N" x7 S
ns_marquee.document.close()
5 L/ ~$ M- z; oactualwidth=ns_marquee.document.width
: ~4 t, g9 a0 S9 V+ G- g, C: s}
" a, h- {* v8 v6 c2 q) W4 k7 vlefttime=setInterval("scrollmarquee()",20)7 Y, | A% ?6 V
}/ w- Z: P3 z& ?* A
window.onload=populate. W6 w8 ?1 k& |
) \$ T- Y# A! i. b9 _6 R; _7 gfunction scrollmarquee(){0 R f0 z+ H7 Q$ |: Y
if (iedom){
" p$ w C- k7 D2 T) V+ lif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))+ {' K" @6 l* w5 E
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
# s$ G8 V. W1 _: Melse, ]' V, V: w9 _( B5 m- P$ e% V$ t
cross_marquee.style.left=marqueewidth+8
% ^! P& D% R$ H
! Y' M4 u9 P2 c! |6 K& S: e8 H}
7 K/ d$ |7 G8 a4 Z% }; \5 ]else if (document.layers){
$ Y O9 V+ m* R9 K+ iif (ns_marquee.left>(actualwidth*(-1)+8))
- x- N3 `, ?4 \& A( Tns_marquee.left-=copyspeed
1 J8 l% @8 j0 G. e, \2 u: yelse
( \; `3 m9 j' X- m! i. D, Rns_marquee.left=marqueewidth+8
" K# s! D+ q2 P! Z4 k4 ?. p% m) Q}/ {3 t" [# @. Y/ B! d% B7 r
}
1 h9 p; l0 o7 }/ N5 a$ E' t0 e
5 ]/ S7 U$ Z+ W) c, `( G3 hif (iedom||document.layers){+ B& b* F$ o& P, Z+ E8 ?
with (document){
- @3 c6 m. i# F% H" w6 `2 Y+ pdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
' f9 D3 Y9 d3 j s0 Mif (iedom){
- J- U8 T0 c# ]) ^write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')6 m" s9 ~$ @& i9 P
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
; X% h. {% [ r* k: kwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')" n1 q9 i6 ]; `; G/ n
write('</div>')8 I3 E( A; C' i6 [% Z
}
* G, g8 A: l( D% v9 }$ ~else if (document.layers){, F0 h5 P3 Q! Q9 _9 s7 U+ ? {! @) z
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
/ ~$ O: `6 a! Z& hwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')# V C% ]3 B$ Q$ G
write('</ilayer>')$ z$ Z5 M, L# n% L+ w! v
}! d! @) Z. }" N& u1 g3 M: r) G
document.write('</td></table>')
% I1 t0 |" y" y4 e- f, x# a* f}
; ]7 K) `; s/ ?" ]3 I+ G}4 I( M/ d5 t% G" z- l" G0 d& R5 w
</script> |
|