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

|
网页之跑马灯文字特效
//修改宽度
2 O9 J1 Z2 ^- t4 w+ e* jvar marqueewidth=3004 h9 i6 E W- m6 ~0 M9 b5 k
//高度7 i" v/ u& j" ?9 M) }4 k( A* G
var marqueeheight=25
: ?% U4 i. i R3 s//速度(1-10)# f% ]1 O/ J: z! m; |- ^% w' s
var marqueespeed=3* x+ s' t4 W6 F: _6 v# l+ V
//背景颜色
6 C9 K9 ~9 P% `) c( V% Svar marqueebgcolor="#FFFFFF"8 Q: T' c5 _) W: a [* L
//是否能暂停 (0=no. 1=yes)?: O* h0 j8 d' P' t* `+ L
var pauseit=1
7 x! j1 h. a, _2 E. k9 _8 L1 a# \; G5 z- S8 V: }* h" ~* P. W
//修改显示内容
/ W# y% U$ c# V. s1 ]3 jvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'' ~, h& i. L0 f) l2 w: o( g
* ?' c! S! c9 |1 M8 S" H8 C( D! y# z5 L, }: D% }" z8 C
////下面不需改变////////////2 |/ X! y; D; c/ T- \5 h
- t: o3 l% ]" D7 |
var copyspeed=marqueespeed: x/ S8 N$ J+ k0 b% {; X% D0 W; _
var pausespeed=(pauseit==0)? copyspeed: 0
4 o5 _7 i+ I _. ]var iedom=document.all||document.getElementById6 r9 t' @4 f9 k4 W, a. y
if (iedom)
+ S/ L1 m1 s. n4 i3 b# w! L5 Gdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')+ b8 K8 [2 z( ?4 D# D* O9 T% b+ o
var actualwidth=''
1 O; U: y: }9 ]2 svar cross_marquee, ns_marquee4 q5 |( E( E) G8 j& E: Q
4 f& c" b+ Y) afunction populate(){1 I) L4 K# H) B
if (iedom){
1 D9 v) v, m. m! \, u: Fcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee, s4 {; Z; H7 K9 o0 C2 K* s+ L
cross_marquee.style.left=marqueewidth+88 q1 X. p4 W# ^
cross_marquee.innerHTML=marqueecontent
0 W* c5 N6 I Iactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
9 E; K$ k; `% G4 [}; v& ~3 N' w$ T# b8 \' _ j7 T' J
else if (document.layers){
! v/ P7 O1 `6 o3 g0 d+ \- Ons_marquee=document.ns_marquee.document.ns_marquee2, t7 o6 b' V, X
ns_marquee.left=marqueewidth+80 I. N3 h/ ]" B! t3 z$ e
ns_marquee.document.write(marqueecontent), V5 q$ v' X0 p9 V0 L+ ?
ns_marquee.document.close()
' y g: K7 V, j" ?* i1 E' Bactualwidth=ns_marquee.document.width+ b. z3 T% e! t& G- u) T* [! y! P6 m3 f% [
}
+ P# S3 F8 x. h# [) D2 I9 m/ olefttime=setInterval("scrollmarquee()",20)
$ b7 r! J4 S. {}
2 a4 x/ Z' _1 k; t. c' qwindow.onload=populate
- f5 \2 M0 }0 L8 A v/ A% _' h
) E3 q: a$ R2 R% v1 y8 Ifunction scrollmarquee(){
( Z8 b9 d* s! lif (iedom){
, T9 R7 p1 R8 x* Dif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))& O) B0 f }. D: m) |
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed' [( f; u4 O/ W8 b0 {
else
" Q8 D4 c0 {$ y, }cross_marquee.style.left=marqueewidth+8! w6 Z$ y& F- A9 R
8 y& t; c0 I, ~+ E
}( y; q9 q8 H7 G2 {5 q
else if (document.layers){
! d2 ~+ ]0 }0 cif (ns_marquee.left>(actualwidth*(-1)+8))- U4 ~# P7 @& N$ t" O
ns_marquee.left-=copyspeed
# {4 W9 e4 Q9 relse
+ b9 D! D$ ~5 T+ Kns_marquee.left=marqueewidth+8
- }. n+ [% {# y4 f9 h% e; F, J}+ N0 x, J0 o# d8 B6 Q4 F
}! [1 R" @ [9 ]( p' d3 h1 \
$ v3 ]( M# F9 L6 e; h7 v* ~if (iedom||document.layers){
' l! [' j, {6 K# l8 v* mwith (document){( ]+ P& c8 m( v
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
7 \% Q1 |) f O# h. A; I! Jif (iedom){
5 N5 o3 s Q) Z* a7 \/ _write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')5 q9 T0 q/ \1 G6 o7 p
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')# z/ q2 y. T' w$ k
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')+ _, j# h/ _5 W. w6 D& @
write('</div>')& K+ x7 v/ A- S5 z$ n
}
* J: \5 I/ Y2 |else if (document.layers){
: H r/ R- V$ G) `4 \write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
9 a1 h( ~2 [ I; j2 Q+ C8 |write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')$ z) ~& y0 I3 ~3 j, ?
write('</ilayer>')- }& D" X5 `3 _3 [' f
}
$ }, G- f$ C! w& h$ t* u$ e* A# Zdocument.write('</td></table>')
) s4 |4 v/ c6 [$ u. k}
- M6 f. P1 c/ W9 M1 X}9 C' C+ J" b' a( ?( j2 a$ c
</script> |
|