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

|
网页之跑马灯文字特效
//修改宽度2 t- I; L: Z7 t- }
var marqueewidth=3007 c+ R4 y, M8 d
//高度
1 G" N7 l; {2 ]4 A3 Q+ Svar marqueeheight=25; N+ b4 d# @2 K4 U# ~6 p1 d
//速度(1-10)
" E$ `8 Q( i9 F& R% l3 ~$ Kvar marqueespeed=3
& n! D0 ]% ^# [+ J- l( t! V m//背景颜色$ m: v! x; {+ U) j
var marqueebgcolor="#FFFFFF"
8 q+ w! ~2 G% \2 X) f//是否能暂停 (0=no. 1=yes)?
2 [" @1 F$ R! z0 s {var pauseit=1- T$ z0 V4 G) @- L* V/ j* F& K
1 [! @$ l+ g' |. U2 c2 @
//修改显示内容
8 z. V [4 j& F& `. f7 P* Z$ Q6 Kvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'- |- z3 s1 I3 D3 N( S" n
* h4 z$ ~, V5 f' K
+ T0 W/ D4 l% c; T' r////下面不需改变////////////6 q9 G1 J3 h1 c0 X( g5 u* d
* Y) ?$ y7 D) c2 j/ K, f9 R" | e
var copyspeed=marqueespeed5 X8 ?9 W# U8 E' R
var pausespeed=(pauseit==0)? copyspeed: 0
4 r( Y. j" K/ [( zvar iedom=document.all||document.getElementById
" {# k7 u" B3 J5 J& cif (iedom)8 N% G% z8 ~2 K6 W9 @4 ?/ c: k8 M7 A6 ~
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
1 ?- R! L7 M. T9 K/ I7 ^4 {var actualwidth=''& Y) B8 {) {1 k( v5 D- `- `# w
var cross_marquee, ns_marquee
. [0 }( N* E+ e& D" v7 ^
: s# p0 y3 `& r! I9 `function populate(){
& g( u; H9 r ]if (iedom){
7 b9 {1 A+ x& b$ qcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
, k6 ?# }1 c) i( i) B, u/ H! Vcross_marquee.style.left=marqueewidth+8! ]3 S ~) z( c+ t& ~ o! @# z& I
cross_marquee.innerHTML=marqueecontent+ z; I5 H! l7 }! d& m
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth. Z" M, u* W# D
}
' H8 R! x( r2 `; telse if (document.layers){5 v, x9 a' c2 \/ @9 ^
ns_marquee=document.ns_marquee.document.ns_marquee2
: K* n8 Z/ d7 M7 r0 T. `% p7 y6 {ns_marquee.left=marqueewidth+8
4 ^8 u1 c, D- S \/ v/ Tns_marquee.document.write(marqueecontent), K2 I h4 q/ N& h. m) H; W1 |
ns_marquee.document.close()1 r( m0 j# E; }& w3 }
actualwidth=ns_marquee.document.width
' x! k2 v; G) ^9 D, _# `# L}
) f3 O; J k: }8 k8 Z5 ilefttime=setInterval("scrollmarquee()",20)+ @! G( J1 B4 S5 q0 r
}
* [- f; _* e$ `4 l/ A2 [7 ^# zwindow.onload=populate
/ n8 J/ E2 C7 ?, p7 B+ {1 g) H) }2 y5 I- R8 b- S9 t$ V
function scrollmarquee(){$ C8 g: I1 `% ^$ J% @. `; T
if (iedom){" t9 i9 H% S9 U: A
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
7 G4 K/ g" c2 ^. J: [, |/ o7 {cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed$ h i: Q+ Q$ a& v1 M0 x9 _
else
N ^8 e8 v1 [" kcross_marquee.style.left=marqueewidth+8
$ X1 g9 Q$ U* e) k3 _" z" }6 ~) D+ j# U; e& ^ z' d1 M
}7 c; H9 s2 a/ R( z4 x
else if (document.layers){2 V% W" q( E! h
if (ns_marquee.left>(actualwidth*(-1)+8))6 \9 i: F" }$ U6 H
ns_marquee.left-=copyspeed
8 z: Z. f d; l8 q( Helse
/ O. o ~* t' j+ r- {# {2 L) |ns_marquee.left=marqueewidth+85 V$ @2 Z7 P% t: \# V+ i4 Y
}+ S9 F. f$ q/ H& Y8 A7 @1 ?5 u
}
0 J4 l& p2 i/ V% g4 {/ ]0 y' P; x( o8 u4 s; W+ o
if (iedom||document.layers){
- _. Y- h8 z. I9 b* H+ bwith (document){
/ b8 j" z% k+ c8 i/ Q [; Pdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')0 L2 Q7 f% O, @) f5 @- \$ f* m9 X8 G8 }
if (iedom){& Q: n! E$ v+ P" w9 a
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')+ Y1 t' f+ n7 S
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">') _9 }! i6 j) k* E6 P; x5 `) U% G
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')1 Y4 b* O6 b$ ^" k, y
write('</div>')$ P! M3 [+ ~3 [
}
. A1 Z, J+ L1 |! T9 W, r+ @else if (document.layers){
# n, x: x9 I0 K8 E5 ~9 A; e9 lwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
2 K: M3 }7 J+ @# {8 K/ t! W8 F2 owrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
% k- `7 N+ a* Zwrite('</ilayer>')1 @' G9 d( S4 ^+ p0 Q9 |! |% e
}/ F9 {" X; K; F$ j4 l/ D
document.write('</td></table>')
3 G2 F* {* T" w, _}
3 f) F4 N+ {) P) R6 k}& Z2 b' \+ w; d* \1 m6 q
</script> |
|