返回列表 发帖

网页之跑马灯文字特效

//修改宽度
* O* W# W# v4 l! D7 Hvar marqueewidth=300
: v) [4 c) ^' i  g) a//高度
2 f% T. R/ Y/ q4 M7 |  Avar marqueeheight=25+ j. d- Z2 {$ \. F/ |' _
//速度(1-10)
0 b3 B& {% U2 y" uvar marqueespeed=3
5 v4 S. m0 u4 B5 u+ ]+ }//背景颜色
* O3 ~6 {6 z6 M0 e7 `; n! Rvar marqueebgcolor="#FFFFFF"8 s0 m4 B( F) S* E8 r
//是否能暂停 (0=no. 1=yes)?2 w$ [/ l2 ~* V, s8 v. q
var pauseit=1
) w5 e1 z: z# Y+ ~; ?/ M; m9 L2 w  [1 J
//修改显示内容6 Z& T; Z# ^! D' _) }
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
8 t9 h7 I: k* d/ t
6 `6 |7 x7 @. ?
8 A1 t# l( t" U7 z////下面不需改变////////////, V; Y5 Q3 Z1 V3 g

: c0 [4 K7 O/ y  Q3 Zvar copyspeed=marqueespeed' x9 A1 C3 x* E4 M7 m% z
var pausespeed=(pauseit==0)? copyspeed: 0
: b1 E, H0 M% xvar iedom=document.all||document.getElementById
4 K3 M: D/ v- l/ [; c: T2 ^if (iedom)
7 D/ H- M/ z" V& Mdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')/ Y1 ~* @5 B! K4 v2 ^' c
var actualwidth=''
1 }! X6 v$ p" Y. ~( `! o2 G+ zvar cross_marquee, ns_marquee
- K8 F0 K5 C: ~% |: O9 m+ u
: @5 V+ U. j9 z" H3 l8 }1 j3 J% z# Ifunction populate(){0 N8 W3 {  ^9 a" v4 L# _+ \2 |2 m2 _
if (iedom){
) E* ~* }1 q# f% @- @/ ?' l! Bcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
8 J" |( W7 `- b" S5 Y. ycross_marquee.style.left=marqueewidth+8
- v6 ^* [0 o6 w0 s8 i6 j3 R* {cross_marquee.innerHTML=marqueecontent
) d6 F( i! ^4 H* q1 w; }5 Jactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
& l2 H3 e$ u; N- f4 L+ V: x}
& h$ F( W8 j8 u& @( Jelse if (document.layers){
8 G* l" y- T' rns_marquee=document.ns_marquee.document.ns_marquee2
6 m* V! H( |5 ~ns_marquee.left=marqueewidth+81 ^4 n0 V  y+ u% ^3 d& p# N" H0 O
ns_marquee.document.write(marqueecontent), }, C+ R- k2 Q2 C) i
ns_marquee.document.close()
5 ]' T; `% a) K' Factualwidth=ns_marquee.document.width
. Q! h5 z. h" H$ |; [}# m  R( {- P1 l! N5 U
lefttime=setInterval("scrollmarquee()",20): w3 K/ i0 c9 g% @3 Z! c# Z+ j
}
5 B) n3 c# T! E9 {- g) q2 {2 Ewindow.onload=populate4 s" u7 g5 o& q5 y1 _5 K/ v$ @

7 Q2 r& Q; k8 T+ l2 I' X. Mfunction scrollmarquee(){, u$ Q2 s1 b' N# f5 d  W
if (iedom){
# F% E4 q, ^: G" }+ I* _if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))3 Y$ G6 c) V- J/ s6 K  \
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed6 W: y1 T! J5 h! u5 C7 t% Q
else
; [% u* s! j  F. H* C6 h- vcross_marquee.style.left=marqueewidth+80 z+ y$ Z0 [+ O! l
( G* R! Z  L# x; S. |2 e
}# W) }2 j7 {2 |& O5 i8 k& ?' n
else if (document.layers){
' S  K$ y  u+ x8 T, g0 {; |if (ns_marquee.left>(actualwidth*(-1)+8))
1 M% ]: r( t8 M( jns_marquee.left-=copyspeed0 }+ w8 G/ r/ q7 Z' S# l: r
else
$ O: u( ^- }: Gns_marquee.left=marqueewidth+86 p8 l3 ^5 ~) w; D* H' O0 A( {
}6 M* r9 i- i; ^7 c5 c$ _5 b! K7 s
}' X* \) x9 x& t* M( Q6 I* n0 ?
* Z/ Q/ s' S# c  _6 t
if (iedom||document.layers){
5 C' K0 J9 @8 H0 N/ x) N% z" Pwith (document){2 w0 C# w& z) g$ J8 c
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
; ]- Y2 P( k2 C) L, _% p+ Qif (iedom){$ A6 T; E1 o# Q! B  t+ Q- Z" w9 }
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')& w5 W* o/ u! s- c3 f
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')1 t' U) e$ Y# ~
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')6 j6 Q$ |0 ^# N/ X3 I
write('</div>')2 m0 U0 {4 q, x) Y# p+ o7 Y
}2 q) f0 q' F* t& @  }7 \
else if (document.layers){
# v$ b" }5 o1 ]8 X! cwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
$ J! o" o9 n+ O8 i$ q* owrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
0 m2 I4 i/ I- N- W0 K4 Owrite('</ilayer>')
$ A, h* }* w! Y+ w- u$ X}! [# s4 \4 H" s: B, Y7 |) h6 I
document.write('</td></table>')/ A& d  `! n/ G8 U! z
}7 r: L+ P$ @0 p7 t/ b
}% \' D! r/ z7 |( {. K$ j4 a
</script>

返回列表
【捌玖网络】已经运行: