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

|
网页之跑马灯文字特效
//修改宽度
+ `7 p* R3 X8 ?1 uvar marqueewidth=300
) i2 X0 D- g) \//高度! o" U1 H/ q: }
var marqueeheight=250 r2 Z' N4 g9 l( Q: ~
//速度(1-10)$ B" n+ y; i3 r$ A# _
var marqueespeed=3/ f' t9 J4 C6 V! R8 R! X
//背景颜色
$ H! L1 O" x; ~var marqueebgcolor="#FFFFFF"/ p" T' z3 h6 q t% D
//是否能暂停 (0=no. 1=yes)?
I& ~, a: r0 ^var pauseit=1 O& e. F; k/ t0 D0 y
' C& M7 N) r, r% ?
//修改显示内容3 \$ F' V# l# l4 w" o v
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
& P: {" S a1 `! J! Q# B7 E% X, f H4 N3 D
* W, ^* N# c. R////下面不需改变////////////
" N5 U$ ^- U5 u( b1 U9 y9 L: _
4 X% f0 M# ~; P ]4 c4 N4 Vvar copyspeed=marqueespeed
, r+ @3 |5 }6 D9 T X3 x6 dvar pausespeed=(pauseit==0)? copyspeed: 0. ]* X: e8 l. U$ w9 z0 ^8 d
var iedom=document.all||document.getElementById% l4 k, o: ^- `" W
if (iedom)% O+ E; W0 J$ N0 f6 T9 @$ V* G
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
' {5 `! m+ p+ I7 U0 R o$ e7 Zvar actualwidth='') b% R$ z7 G0 [) h3 u% Q$ j
var cross_marquee, ns_marquee* P3 \( [: H: c$ V$ s0 l; Z
& L; N5 m" e3 l
function populate(){; A9 d% M) e6 E' A
if (iedom){
6 O& W$ _2 t: T6 |0 ycross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
* {6 `6 q6 ~* q& a: M& U( ^# g- pcross_marquee.style.left=marqueewidth+8; l. i4 A" b' B! p
cross_marquee.innerHTML=marqueecontent
8 @4 m5 a+ R) u* K, Gactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth( `6 c( O7 _( V' `2 g2 E+ u
}
4 p0 P8 u U2 V- ?else if (document.layers){7 A- f9 d( a% b" }$ {) S: b( Z( Y
ns_marquee=document.ns_marquee.document.ns_marquee2
7 o9 L2 \# f3 @4 Kns_marquee.left=marqueewidth+8# k; W U5 C' k9 |
ns_marquee.document.write(marqueecontent)
9 a- g) N! f8 G* j. j2 W3 O. Cns_marquee.document.close(), e/ A) T; Y6 u% K, C8 `4 L/ K
actualwidth=ns_marquee.document.width) |9 K4 S% x' t5 c" ^; U! N
}
- f4 M7 R1 j6 s& ~lefttime=setInterval("scrollmarquee()",20)
* H& s9 d. o# W& g+ y! m2 \; F% _ L}
1 \9 S; {' B0 S) Kwindow.onload=populate2 C! A% }1 P' f L' {$ L6 ?
2 f$ J& E7 e. {8 s: H' |5 Z$ J
function scrollmarquee(){, L M* j ^& i& A* M
if (iedom){
0 w4 Q( T1 t8 Rif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))6 A- S& g, L1 O2 C$ G
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
; m) ?. O9 L$ k5 I, _, f5 p, telse
/ k/ R, [8 B' V1 p1 H5 L- Lcross_marquee.style.left=marqueewidth+89 o' P2 Z3 |, K. ]6 ?1 W' b" M
% p9 {7 U& d, \3 O
}
% d" H+ c- w4 ~9 telse if (document.layers){+ J0 f7 O% h+ ^- d
if (ns_marquee.left>(actualwidth*(-1)+8))* L$ P" ~1 F6 A2 j
ns_marquee.left-=copyspeed; O& D( z& n/ @( q* F) B: k, y/ K
else
. i3 n7 O3 w! |! ^( U; F" f! U) fns_marquee.left=marqueewidth+8. m a3 X% e! c: U3 |* S A: F; ]9 g/ q% x
}. D: C- \% S) f
}
* @2 A+ ^8 o0 Q
- V @* _+ L; D( z/ |if (iedom||document.layers){7 n ~" C" f( R0 X! `( Q
with (document){
( ]6 P/ i/ D# t ~/ o0 z; h# Z! Pdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>'); ]" @ |- ]! ^7 X& E
if (iedom){# g0 ^: n2 g1 T6 @5 ?
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
) y6 x8 J% X; i* |5 h! A3 M' ]( Nwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')7 X5 v. N+ s# E$ W5 r. i' f
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
% A. E4 y. t' wwrite('</div>')6 @# C; z! A. v2 B& L2 z
}; q7 U$ _) V" t+ e3 w- m: F$ o. p& ]
else if (document.layers){
( @( L, ?; `# z# Uwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
$ ~$ e4 R$ L w- i" j# ?1 C$ Z( @write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
6 r: G G$ o- k7 |1 ~; ]9 swrite('</ilayer>')
s* O# U' {, k8 U}* U* B: h) z$ |% P
document.write('</td></table>')" Y2 h1 w3 s u }# s, T& n
}$ V& _- |4 ~5 m: e0 j2 {
}
; a. ]/ ]6 d& J: a, Y: S</script> |
|