返回列表 发帖

网页之跑马灯文字特效

//修改宽度' b$ f% m6 @- }' V/ G
var marqueewidth=300
" l  J- X2 a- Z( e1 L) `//高度0 P7 Z. v- {( P6 ~
var marqueeheight=25
. V$ h7 o. W- I) T: a7 y% c, i//速度(1-10)
$ Z1 _+ `7 E6 Z1 U& z/ ovar marqueespeed=3# m- I8 V! u0 S  _& d
//背景颜色* w$ F* F" V4 W# r; ^5 q
var marqueebgcolor="#FFFFFF"3 }% k1 I! ~% M; _1 H- f
//是否能暂停 (0=no. 1=yes)?
2 G; i9 {+ z7 a" Fvar pauseit=1
. g0 T; Y2 Z' t( |1 |  h/ X% d1 Y8 I! S- ^+ m4 f
//修改显示内容
4 t3 B! z* m$ P: x9 z. z$ O: Dvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
3 G  x0 p& b5 Z4 D
5 m& `" U0 c. A! ?9 t8 H; R/ W; B+ ]& a" j; g8 E5 t
////下面不需改变////////////- S- W$ Z) U8 W! q& O! e
% V" g6 n7 Y0 F2 w/ Q, m( T: a* \
var copyspeed=marqueespeed
1 m$ R' B! b2 Y$ r8 F9 ]9 |  X9 s% Rvar pausespeed=(pauseit==0)? copyspeed: 0/ k' @3 a9 U+ P7 n8 I' ^  C
var iedom=document.all||document.getElementById' u3 x: A# D; E; T
if (iedom)6 L* I) B; `# u
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')& I+ K+ V# ]4 E/ I: B: x) z; N
var actualwidth=''3 ]- Y2 J, Y" z/ U) L* a
var cross_marquee, ns_marquee
6 h7 I3 C/ w+ M" g0 W- T6 i$ c7 G0 ^' ]  B
function populate(){
% z0 }* K/ L6 R1 n- A% g1 @. ^if (iedom){8 y8 O! w' X1 P0 W7 ^( k, }6 w0 [& d) L
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
* K# D; `. f  {! j( v! H8 p& [( r7 zcross_marquee.style.left=marqueewidth+8
- A. K, l) ], M) zcross_marquee.innerHTML=marqueecontent7 C1 l5 K9 W5 X( N
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth1 e8 j6 X8 P: `/ H8 v
}
! I. U- j  w! i. T7 helse if (document.layers){
! m; q" R, l# n* E# @% lns_marquee=document.ns_marquee.document.ns_marquee2* S1 K. z9 c. i7 `0 ^8 i- n  A
ns_marquee.left=marqueewidth+8
* D+ P/ y  n1 q; cns_marquee.document.write(marqueecontent)7 x: V2 K9 L3 P1 O) [
ns_marquee.document.close()
' y8 [8 p4 P5 K4 u8 N! f$ Ractualwidth=ns_marquee.document.width! M: Q2 o. W+ k  P4 e8 \
}8 G  u# O2 Z7 u
lefttime=setInterval("scrollmarquee()",20)* ^, ]$ r7 L2 |' L8 K
}
, V1 ?7 e  m  V9 ^- b% U. Dwindow.onload=populate
" ?8 ?6 \& q$ L/ H  H/ f+ F8 X+ y* ?4 }5 L7 P8 J  i+ c
function scrollmarquee(){# s* q& X0 ^: `" G% F
if (iedom){$ m9 [' K$ a5 U8 q3 s! C& U! F4 r
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
% S6 r( W5 C+ r' y! Across_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
1 v7 {" j* p* B9 j. ?# kelse
- U3 Y: L+ {: M& E4 ]cross_marquee.style.left=marqueewidth+8
1 d" Q5 P! U, Q
# L9 T' w1 Y+ p* A$ d5 E}# `; q  G; T' q# ]& q0 B
else if (document.layers){
- V$ m# p8 L: ?% Gif (ns_marquee.left>(actualwidth*(-1)+8))" Y' s6 G8 n2 V, d9 i* Y/ x
ns_marquee.left-=copyspeed
* Q1 Z: z1 @: n7 Melse
+ |5 h7 F3 m" \) `/ _  q: [ns_marquee.left=marqueewidth+85 s6 D3 X' x; W, y
}, v/ d5 b3 [7 d  T7 x4 Y
}8 t0 u  s7 U% ^# [

& j! a9 e+ ^4 wif (iedom||document.layers){
* ?, X/ L) _4 q: Ewith (document){& u2 B( m3 x6 u# _/ S- a
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')$ [1 Z7 j: _6 w4 {* V
if (iedom){: F) L" p* O) z$ O
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')$ A& X3 r4 i" [
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')$ y& I0 J$ `  \+ C! T; E
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'): P5 s) b8 h+ Z% Z
write('</div>')
) g3 u8 F: g# _: w4 J6 M7 G8 M6 [* y}
, E& g% t  t0 D8 b9 i4 w% Belse if (document.layers){  l' \1 N" @  l" B
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
9 n' {+ `2 u) Z$ jwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
& n' v$ c% ?* w6 @write('</ilayer>')
8 {( Q! Q' J) v& q( m6 _}% }4 Y. W- I, ]/ |  P& J9 C( j
document.write('</td></table>')
7 r4 T/ m: |/ Q6 {( x9 T}
' K# b. W; O1 o: L6 t}
' G2 p5 F+ A0 G</script>

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