返回列表 发帖

网页之跑马灯文字特效

//修改宽度6 g, j( r  a! \0 ~# U* W
var marqueewidth=300
6 ^7 t' ?  n( |+ ]//高度
" h: n' _& T  q6 i) P" c+ ^var marqueeheight=25/ x  o+ n$ [9 a" m
//速度(1-10)* H' x/ o0 _4 ]  S
var marqueespeed=3
9 D* O3 u8 K' ]& t2 g/ y//背景颜色
9 ~5 ^- `& t9 o( z9 P' G2 I1 @var marqueebgcolor="#FFFFFF"
9 B' w$ U6 f8 K$ a1 v6 e8 t% A% T//是否能暂停 (0=no. 1=yes)?2 Z/ y- e+ n+ e) o# v# T" f
var pauseit=1
8 |0 L, E/ G% U- j- r9 j# U7 K% d6 ^: g9 }# l- Q0 `- S8 w
//修改显示内容/ H  A% n, j' V. O! d
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'6 j3 y1 o, L. h% O2 ~" w# M

9 q% `& E- g. q6 r
8 T( M( b! \: P////下面不需改变////////////
, J! Y! k3 m, }  V4 T, W: E! j9 H3 F: U) C) ~. W" i3 z# X% I
var copyspeed=marqueespeed
1 p4 E- N5 \9 V$ O3 `5 k  Fvar pausespeed=(pauseit==0)? copyspeed: 04 z# T9 C5 J$ t* i, O" N$ _
var iedom=document.all||document.getElementById; i/ `0 u$ G5 _; `$ j7 U
if (iedom)" B1 x! b( D& T
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')! {9 z& ?. R1 T' R6 Z# _& Y" M
var actualwidth=''
! c% k7 m: K( U. V9 I$ E  \0 pvar cross_marquee, ns_marquee
7 g* Z, V; ?7 S6 l! n/ v3 X3 M" T- t$ C  G- f& _; E
function populate(){! s9 V& c9 z: Q/ r) R2 ~% ~& E  d; f
if (iedom){* t! N6 b+ |. K5 b8 O( N
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee# \( c; }  H$ ~& v' f3 z' @, a
cross_marquee.style.left=marqueewidth+8
5 ?) z( G3 E+ U3 |% X9 ^4 b7 pcross_marquee.innerHTML=marqueecontent1 {- d& N' _8 Z8 i2 {6 ~
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth  @. Y+ d+ @% r- D# g" t
}
! F4 z% U) b! c: N% A) celse if (document.layers){1 U. X& W4 }, d! q1 J+ \
ns_marquee=document.ns_marquee.document.ns_marquee2, I  f' |) L. x2 T
ns_marquee.left=marqueewidth+8
- k( j  [1 K" n5 y  W! n; F( c/ i+ pns_marquee.document.write(marqueecontent)
0 h" m* H. y$ l  M" ens_marquee.document.close(); e8 m- ^) Q8 r1 Y. C* j! B+ H: r
actualwidth=ns_marquee.document.width' c4 ~1 T8 V. z8 Y+ i. J$ S4 l
}% ~7 I& O" d/ g% o
lefttime=setInterval("scrollmarquee()",20)) }, z# ?7 e$ p
}
. [* P; B4 u( |: vwindow.onload=populate8 M* m. F1 \7 H

9 H$ S8 R9 b) E( c& ffunction scrollmarquee(){
* n4 V8 V$ z# Cif (iedom){
; `" n9 [) |, i1 }7 \/ q- ^1 Sif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
! ^3 y* U& }: v& }- h9 G( f1 vcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed, O0 d& X/ y& P5 z
else
- v& w1 g% ?$ ^cross_marquee.style.left=marqueewidth+8
: a6 j+ ~* ?1 O4 }4 _. D1 ~
' k! `# q9 i9 ~: Y+ K0 e' }* g}: c1 ]9 W6 Z( z; B# w5 f, T
else if (document.layers){
$ D( w  P3 _: X& O+ g: oif (ns_marquee.left>(actualwidth*(-1)+8)): l) X8 S' V( Y8 h
ns_marquee.left-=copyspeed
( K- z% }- d- R6 ^- Gelse, X* z7 w) W( ^9 C7 s
ns_marquee.left=marqueewidth+8& F4 a8 C6 Q" w! V% q- _
}" q& W) ]! Q3 S& u+ }
}" P$ z8 C1 b7 J# d+ @7 E% W
) C, K9 U: v' ]) g# i, N
if (iedom||document.layers){
/ Y3 F8 N% |9 b& }! X; X1 }- }with (document){2 p% f0 b# Y: g. i7 {! H+ S5 K
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')% N8 @$ c0 @- u5 Y
if (iedom){6 R2 g: U" u0 R2 ^% T1 H' V
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
0 g7 ?, U1 V8 \6 i( Wwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')2 i8 H* a0 |; v% r( e
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')" Z: j+ m* s: R2 B. |& E
write('</div>')% w0 f3 \  Q% ^* d& ^) s$ j' _2 I
}7 L9 l  a3 Q: o
else if (document.layers){) E+ E- A) k% B1 |, K% d
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>'), c" K1 o5 y$ Q& p5 w0 d$ a: b
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')0 o* B1 a, y+ X% w7 y
write('</ilayer>')
/ O( y) s; Y: U. j; f$ G* Q}
& D5 k- [2 g) i1 M' mdocument.write('</td></table>')$ `2 K* T9 ]- H; J- a" n1 z1 b
}
2 R/ p3 y1 v9 }0 G" y1 n}
) ?8 ?3 F. N6 Q. R8 ~8 H/ W  T</script>

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