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

|
网页之跑马灯文字特效
//修改宽度" h; _7 O) o0 c* p; @
var marqueewidth=3008 \7 P- c! i) z% W; L6 ]9 [2 a7 X* ?
//高度
/ _- u, i4 S: P7 m( F8 i" u* N$ Svar marqueeheight=25
3 Q l$ d8 I1 M, B0 R' g; y//速度(1-10)+ a1 w: k5 n- E+ y1 c
var marqueespeed=3
; d& K% Z4 A* C/ L//背景颜色9 q: {- H. ?6 J2 C& ^# d
var marqueebgcolor="#FFFFFF"
# W1 s. z: @$ @2 }//是否能暂停 (0=no. 1=yes)?
# T. M; s0 I5 }7 ^# @" _5 Z' rvar pauseit=1# h( H/ }9 d5 E
7 m* E2 u5 c( O1 @# W//修改显示内容" Z1 t7 q$ A: I; t3 G) L1 P
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
; }2 _0 J2 G3 C! U: I+ O' f* d
- R5 Q- w, H0 _8 w6 p( O
+ h3 m$ G3 v7 G( x- v7 n2 B7 j////下面不需改变////////////0 `* M5 z2 E$ g
$ x5 |2 Q# q* A1 I. V- ~' I6 q3 X- \
var copyspeed=marqueespeed
) A" P$ d# A: S$ k9 cvar pausespeed=(pauseit==0)? copyspeed: 0
% Y5 y; B0 ? r. k" x: G/ Lvar iedom=document.all||document.getElementById) s- l" u3 Q( } e) Z4 }+ ~0 I
if (iedom), Y5 g( o/ T7 ]) M
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'). {2 c; [+ E0 T" l6 W
var actualwidth=''
( Q% Q5 d3 R. X0 C: Qvar cross_marquee, ns_marquee
) K3 r) s$ D9 D5 N( X- A& L3 Q
, D- E$ l2 a1 |& w+ l0 e efunction populate(){5 ?3 m" B* d( L. D6 f+ k+ K2 Y$ n2 f
if (iedom){
; c: |; {7 Z, Y3 l4 ?0 h( scross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
) w$ f6 t9 c" y: ?, X p9 _cross_marquee.style.left=marqueewidth+8% w& i* x% e; ^
cross_marquee.innerHTML=marqueecontent
/ S+ w% _5 r1 M( }2 b' Bactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth/ { j, O4 \/ q5 n4 b3 a2 w8 W/ z" T
}9 \& m4 w: T4 X1 n) t+ S( j
else if (document.layers){
6 {% N1 Z- e" S. |$ S% g8 Pns_marquee=document.ns_marquee.document.ns_marquee2: |" }& P# R) x. F4 C
ns_marquee.left=marqueewidth+8
- a6 r, s" r9 `. c, [5 C1 Ans_marquee.document.write(marqueecontent)
' v( Z$ b8 V( I! A3 H; H$ \ns_marquee.document.close()
8 ^+ e! {- h c/ ^" r8 }actualwidth=ns_marquee.document.width6 h7 M4 }+ o; s9 P4 W
}
/ Y' R! I& ]( {lefttime=setInterval("scrollmarquee()",20)
0 k% U% q4 R2 E& Q}5 n X; p4 v, `2 R P5 u( ^
window.onload=populate; e. Q! N* I, Y7 w& `
6 o/ ?& E3 d K( c* ^function scrollmarquee(){! q h) W( L4 U4 N0 @" H% u+ \
if (iedom){
! {- J" O) V$ n) o5 G( Xif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
% U4 I J2 [8 M9 @! R8 q1 Bcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
( V. _0 Z* ~& H/ ~, Ielse
; p7 o5 I" i: ]* C# u" ncross_marquee.style.left=marqueewidth+8' N. Z9 d4 s6 e* L4 ^3 @2 I, k4 d
0 c9 ?% d" I+ E, p) [}
# p, M! J v" R \1 P$ S0 pelse if (document.layers){3 X' Z3 A1 N( K
if (ns_marquee.left>(actualwidth*(-1)+8))) t, Z+ }$ Q0 q) Y' u8 B4 v
ns_marquee.left-=copyspeed$ v( S5 v, V, o! Z" x
else
3 P% k3 p7 e$ _; F3 f* A6 ]ns_marquee.left=marqueewidth+8
' B4 v+ |7 l& e+ \7 }$ |% \}+ q8 D& y+ f/ y" Z' @
}0 y" a" X# i7 o4 c$ x2 g
& n; {* e9 ~: T, H8 }/ A: v$ a
if (iedom||document.layers){
+ Y& C2 u/ q$ D. ]0 \9 p8 Xwith (document){
2 {6 u, b5 P: p* \1 r6 m2 xdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
, r) ~' Y" B5 L' Y: sif (iedom){ U6 |2 f" I% h/ F9 V, x N
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')! K% G' ^" F6 [+ B, B3 I' v
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
. G! h. K: l; E- k+ ^write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
& F& N( Z9 i8 m$ S$ j: Gwrite('</div>')
' ^4 a: _$ R x" \0 p, l, V}8 N Q0 E/ Y# g7 u
else if (document.layers){
. d5 L5 O. C) N/ Y1 Rwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')8 X+ d. z3 q' D d, F7 R
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')* y* B. |" u7 O( b, F( O7 J
write('</ilayer>')
. {. x5 K; F; H: {9 A}
1 \" D, t9 |4 I! }document.write('</td></table>')
9 _! E9 y5 l; k) t}
+ h, [- a. T1 M}
% {" ~: n t! m! |% y. W' x</script> |
|