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

|
网页之跑马灯文字特效
//修改宽度
$ j7 [2 I: x, nvar marqueewidth=300
4 S9 Y+ ~5 V) k7 k/ Q//高度+ b/ J# E; J- m/ R O m
var marqueeheight=25( E3 X1 m- U# I( C0 o V
//速度(1-10)9 P4 O; r. a9 C, x+ N0 D
var marqueespeed=37 ~3 \; _/ u' M6 F7 `' c+ Y
//背景颜色9 ~2 K" q$ g# b1 V, E
var marqueebgcolor="#FFFFFF"% V4 D% @; o( [" D I2 O8 u
//是否能暂停 (0=no. 1=yes)?
! J2 k) {/ H1 f" D U' Z" H& kvar pauseit=1
d' V! h0 F6 r& ?7 `! I
& t& y* d1 g9 }//修改显示内容# t" C& @4 E( f6 e/ F
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
/ E5 V% f- } k3 e8 o) ]+ [6 S. W6 B- G+ F. W* T
) B+ J5 j1 U; J3 \' L$ D# K////下面不需改变////////////6 H4 b( V4 @8 n7 i5 [/ z
. m; t! f2 q1 k7 c. @) P" C3 pvar copyspeed=marqueespeed
- W) _0 ?' C$ R5 K2 rvar pausespeed=(pauseit==0)? copyspeed: 04 p) T1 I. a+ ?! H. Y
var iedom=document.all||document.getElementById- L! x# Q+ F5 g: f8 \1 A" e3 E
if (iedom)
2 x9 S% t/ M! {document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
& ?' A1 \8 D7 k2 Ovar actualwidth='') A8 L4 Y4 X( G% m+ c8 K/ b
var cross_marquee, ns_marquee
! u! _5 q, g3 B( ~+ Z& E% N a4 @ s/ v" `6 Y! a7 y `+ R& T
function populate(){7 C0 O. M# Y* G- q1 P
if (iedom){7 J% N$ d2 R- c
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee5 j r+ U& j/ S- l7 ^
cross_marquee.style.left=marqueewidth+8
5 E! U* k0 W, K# B3 pcross_marquee.innerHTML=marqueecontent" f' \6 g* `3 Q- h% F2 {& v8 \0 q
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth7 }- Y5 {3 U4 A7 |
}
2 @1 P) s5 k3 M2 @. I% l: kelse if (document.layers){
+ k% |$ `) N% B1 S4 P: Mns_marquee=document.ns_marquee.document.ns_marquee26 `5 ]7 g5 r" I( ?. k/ d4 C& ]/ z
ns_marquee.left=marqueewidth+8
" x# Z& U: Z" ?" pns_marquee.document.write(marqueecontent)+ w8 r- T8 x" Q5 A u, }# R
ns_marquee.document.close()
, E. n$ |8 y( `% Uactualwidth=ns_marquee.document.width
8 p# R" w& _$ r, F* z. p5 s5 P}2 O; o T8 R' ~; M$ {9 k- T
lefttime=setInterval("scrollmarquee()",20)
, @7 k% @0 t4 M0 n}
V* |# s( n e; f8 Uwindow.onload=populate+ |: {7 ]8 h; F+ F% U7 [5 F
6 K2 U3 T+ f; I- ?& i9 Gfunction scrollmarquee(){* C3 ^# v# A$ s: x9 _
if (iedom){
; H y# q; ?5 {5 _3 j' x) A( Lif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
# O2 p3 }+ O9 {% ~cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed! v: \: x) {: l* b
else
$ K% F D$ ]5 k0 Jcross_marquee.style.left=marqueewidth+8! ], b/ ?7 }% g4 Y
- t+ M# i. V8 w8 u
}) i8 v3 p8 p6 v- g& E: H" g G0 K
else if (document.layers){1 S0 n3 [2 G- m0 I5 j
if (ns_marquee.left>(actualwidth*(-1)+8))8 w2 p! W, s8 k# ^- e6 G' N9 c
ns_marquee.left-=copyspeed. y p( V4 t% G% ^
else' [$ \- U2 q4 T3 ]
ns_marquee.left=marqueewidth+8
( z! b9 R! } F0 Z" @) w}5 I% }. m" D1 d9 r9 b( u! E: X; Y
}
5 }1 J2 E3 F6 g. [3 i6 A5 B" ?4 n! d% J
if (iedom||document.layers){
- Q) v* g, x" r7 Iwith (document){ P1 t1 \0 B; d4 s& p. X; r
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')- T0 X% g2 |- l- `' T/ B
if (iedom){
* E M4 U- O s% F. y& jwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
4 B9 Y$ e8 e) m6 K: V }2 F( X3 z3 xwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
+ m% t" }6 n$ q$ j: j! dwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'); p% n9 t( m4 X! Y/ f
write('</div>')
6 o$ o/ C3 S5 }2 _}
( n' z" \" k. k" relse if (document.layers){% R- C' A: }7 R+ B
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
8 h8 D* D+ l9 D1 U: ~write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
9 v; D+ m6 C6 Z4 J/ D; Y$ R+ Jwrite('</ilayer>')
, e' \* W* V/ g6 I; z( R7 B6 }}
( g) ]) l' E1 b3 vdocument.write('</td></table>')
# j% l% y% ~* i3 F+ {: I% s}
( `9 s) z& M; R2 Q, ] H}
7 z6 D: w5 `5 Q3 j7 l</script> |
|