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

|
网页之跑马灯文字特效
//修改宽度8 X, W# m Z2 N2 O6 u
var marqueewidth=300
( t9 |0 F. ?" [' b# z//高度9 b+ E2 r y) E4 N
var marqueeheight=25
. j! D- k& P) A//速度(1-10)
4 \9 U, r7 q8 h1 j% ?! F3 i+ mvar marqueespeed=3* }% c s+ O9 K$ `& \' i% N) S5 g
//背景颜色: Q' D" ` [2 Q9 p0 x
var marqueebgcolor="#FFFFFF"& W2 x/ s& d" W* F* M0 V, f$ n
//是否能暂停 (0=no. 1=yes)?* c0 r" F5 Z( b5 Y/ {( }
var pauseit=1
) W1 r. I1 f% j2 X* T: k, A ~) D! M: L$ k. L0 ]& R( r% [& X
//修改显示内容
2 ?0 v8 K$ z* ]$ c7 ]9 T: ~+ Yvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
2 Y$ h6 i) _) k: S. Z9 J: M
1 g0 v* f( L/ x3 q; m% h, w( Q4 n( M2 H: P
////下面不需改变////////////1 P% Y8 C4 a+ ~( \
7 q" ?% G5 ?7 n4 p; {8 v$ Z
var copyspeed=marqueespeed! a# M. P# g* I
var pausespeed=(pauseit==0)? copyspeed: 02 ^9 i4 `1 O3 R! q. r
var iedom=document.all||document.getElementById1 N: Q' G( y. j8 d
if (iedom) F( [- F A) Y) r+ b
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
# j* V4 W+ ~: [& B8 U1 Lvar actualwidth=''
+ j$ y; f2 y9 X2 y/ O; |var cross_marquee, ns_marquee
7 E7 k0 f# P- [. y. G. p4 w# s; k, `* L- I" ?
function populate(){: T7 R& R. _- U/ t- c
if (iedom){7 G) C. ~) ~ U7 ^/ U! _" z
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
4 V$ J2 O2 k: p1 c! p {. y4 |* hcross_marquee.style.left=marqueewidth+8
" Y: t" H8 B" Ocross_marquee.innerHTML=marqueecontent2 m+ C4 |# b" A0 k" \/ J2 w
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
/ K2 H( }3 `1 w% j% C7 V1 ~/ I}
# x5 E+ W& I U6 t- Celse if (document.layers){" C7 K& s' u' M9 ^8 u
ns_marquee=document.ns_marquee.document.ns_marquee24 J1 Q. I$ K/ k5 i
ns_marquee.left=marqueewidth+8
' n" i! G! g! t; w' i3 Gns_marquee.document.write(marqueecontent)8 E; a' H4 v7 x1 U8 `5 g* v
ns_marquee.document.close(): I- p6 T: w0 P N+ F( Y& w2 h+ z
actualwidth=ns_marquee.document.width/ u6 P1 p% X: H& e& v
}2 R5 w, p% E# ` w( f
lefttime=setInterval("scrollmarquee()",20)4 h/ N$ v9 _# V* R8 Z' y
}
V s' t2 I* A. hwindow.onload=populate) u4 `8 |& S! d$ @
E* }" A( b% C# [
function scrollmarquee(){% }/ g' [4 a2 [: E# w
if (iedom){4 e3 u- R7 t! s1 L, q. A; @
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
& \/ f' _) {) _. `cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
' E; k7 u: G' D% }+ Ielse
$ Y' g0 o, ~5 {* [$ Xcross_marquee.style.left=marqueewidth+8
6 r; x9 f) x, H/ L, z: T0 v
( r& N2 s5 E( r0 H8 M}
9 u0 A* S) {% Q: A; Helse if (document.layers){
k7 D. t2 q; p+ g _) Wif (ns_marquee.left>(actualwidth*(-1)+8))
5 Y- y8 @# j: u/ yns_marquee.left-=copyspeed
9 k3 B! d2 [5 S7 E' L+ }0 ~else
0 H; ]6 }6 _' s- o1 M, F2 Lns_marquee.left=marqueewidth+8
. I; U2 ?+ ?1 B* D}
- n' Y% }& D* `/ z% J! _/ M# W}
& F( h$ |4 s1 |6 K4 N% \4 D5 ]. I
# v m) N' Y" E0 vif (iedom||document.layers){
" ~+ w# G6 y* X& u. z: z9 Kwith (document){# i$ H( q8 H; c! a; ~
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')7 E3 L; L; y- \
if (iedom){9 y0 V; g6 o/ Q
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
p1 S3 I0 E ]0 twrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
$ }4 }5 C3 {3 P% ^write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
- Q2 B* f" S( `0 y5 b7 Qwrite('</div>')
# m: \4 e( D0 o}
& K2 c0 z5 a! v( Xelse if (document.layers){
! j" r/ h0 F* q# K+ Cwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
% n) T9 ^% G# Nwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
4 o+ }4 w- z r6 E- j* u3 Iwrite('</ilayer>')- L6 M5 X1 l) D1 n* i" |# O# N
}
` h# [6 [8 qdocument.write('</td></table>')
# w& C( u, q& x* Y}
+ v8 W1 F# H, h* O9 U5 s8 `- n}
* G3 D% j0 L7 P+ ?6 M8 I</script> |
|