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

|
网页之跑马灯文字特效
//修改宽度/ ?) R1 W6 [% o
var marqueewidth=3007 l* C5 c, {2 p; m! X7 C3 H! F/ \
//高度
1 E( _/ |$ R0 [5 U, D0 Svar marqueeheight=25
& A0 [1 y/ C4 C+ I% z2 G% ^1 C! E//速度(1-10)
p1 n7 k7 h# z. [- H1 Gvar marqueespeed=3* M5 `) h" U' j3 A( L2 ]
//背景颜色( i5 ~) F% q2 X& q
var marqueebgcolor="#FFFFFF"
- W) ^! D* z( r% S1 T//是否能暂停 (0=no. 1=yes)?% ?$ a" a1 r) x0 q+ k
var pauseit=1* L d# U" b$ j( l' \% r
9 V8 E9 Y8 a4 i! H
//修改显示内容# u7 _! g# }. ^3 Q3 l: W
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>') O4 c% k4 ~3 o- Q9 g2 x
Q% |) v+ x5 Q4 @2 z0 {% \
' q2 Y) N/ a8 F4 Z! W////下面不需改变////////////4 R1 E4 J. c' E! U
/ j# p6 |' m) v6 J. c- W
var copyspeed=marqueespeed
" w! K- r f# Nvar pausespeed=(pauseit==0)? copyspeed: 0
R3 C! B, i1 S0 l! |% hvar iedom=document.all||document.getElementById5 B; l# p7 T8 K& P
if (iedom)
) X& j/ d' M1 N* v$ `0 X0 mdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'). _$ `9 A& g! m% U$ Y. g* [
var actualwidth=''% d: g3 X3 `$ D* J
var cross_marquee, ns_marquee
$ j3 Q2 {& W; p: I) |/ `& a! E( L |' M1 m Y9 b. h5 t
function populate(){$ O& W( @& [% W- X3 r
if (iedom){
% q2 t, e I( h# Tcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee6 q& b5 ~' ~$ c
cross_marquee.style.left=marqueewidth+84 {; N4 x( Q; A4 w' k6 u, e
cross_marquee.innerHTML=marqueecontent
& ^8 V9 L1 e& s# {" {: Q/ P7 oactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
+ O- S$ R' p- D- D1 L}
+ [- @7 l9 H' g) j) melse if (document.layers){9 y$ Q0 d7 P1 P0 D8 J1 `
ns_marquee=document.ns_marquee.document.ns_marquee2$ v+ v4 z8 q( m( v0 i8 `
ns_marquee.left=marqueewidth+83 T/ {& r5 S/ p) v7 G. @: Z# o
ns_marquee.document.write(marqueecontent)
- o3 h7 q/ G# i8 ~$ u; ins_marquee.document.close()
9 b) f; l! \ R- U2 Z+ p n! K0 hactualwidth=ns_marquee.document.width( D) K3 K) w" w q6 G# U& ?" j& ?
}
8 s, S6 L8 x- c3 ]3 B! ilefttime=setInterval("scrollmarquee()",20)' M" F+ o7 f# i3 [0 @% Y) g
}
5 T3 M8 h* R `7 uwindow.onload=populate
' V0 g" G+ K7 L) o7 O" D: q: y% {1 K3 J+ @; v+ ]
function scrollmarquee(){( j9 `7 y' N3 z3 \# z! \& o
if (iedom){
# W' m6 |; E6 E! r/ O! f- kif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))" j3 m) `* ]) q3 J6 S7 y9 r* q
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
# U0 v9 R }; ]4 melse
4 t8 T+ H+ t- e4 P5 w* p! Zcross_marquee.style.left=marqueewidth+85 T& j4 m( v9 `" ^2 D
& p8 f$ d: b/ p9 J' P5 Z7 d2 h}
: o Y' c7 w5 _4 p) J4 X! V' [) M7 Gelse if (document.layers){
. m0 F/ L# Q+ _1 l8 V! d1 p4 Oif (ns_marquee.left>(actualwidth*(-1)+8))
& H N8 X9 Y6 s; q1 \+ ]3 Kns_marquee.left-=copyspeed' P1 N# m h$ O( G
else7 ?+ \. o% d9 _% C0 C# V
ns_marquee.left=marqueewidth+8( b8 j3 a- N7 v/ X: H5 A V
}+ C( [/ b0 M0 Z4 U- g8 {! l" G
}
) O0 W8 u( _% x
% H( A5 J0 N& C; a* S Fif (iedom||document.layers){
/ v4 B2 _8 |( ]& ywith (document){, c9 C |. t/ u0 X2 a+ a- Q! Y
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
P$ L0 Y% ~/ h' R0 Bif (iedom){
5 z c6 `1 o$ J/ X* v/ Rwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')7 \1 \/ I( I: n; o4 d* o' r
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'): E z% e8 |: c9 b- B: m+ t' I
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')" k/ `" m5 h+ ~$ H+ q r5 {& d
write('</div>')
5 X3 G- O2 W! e% W}
; l3 z% t. }% P) @ i9 I- Celse if (document.layers){1 U' H% Q* f2 E( p' v7 g
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
y+ d& s9 q* I5 l1 c) O6 j& Z# |write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>') g# a3 z0 J' @8 J
write('</ilayer>')
' S: X9 r' k4 o! }# K/ n/ \9 m}; g3 R& Q5 t" k/ X, V; [2 c5 T
document.write('</td></table>')
: ]- j$ l, v4 a# V9 C/ \}
* ?( m9 F, t5 \7 y/ q6 O; p# @}! X" L) c7 k) O9 [/ [5 w9 h
</script> |
|