获得本站免费赞助空间请点这里
返回列表 发帖

网页之跑马灯文字特效

//修改宽度
/ b0 X6 V$ R: q* ^var marqueewidth=3000 X3 C0 W. M9 f: N
//高度3 @1 h0 n' I; @4 D; \
var marqueeheight=25
$ G0 ?* w* B& c//速度(1-10)
* F" E- s( e# J9 o: Kvar marqueespeed=3$ w  o" K" V' f) T. g
//背景颜色
- K. _! _, Z0 k1 }1 G( f% Ovar marqueebgcolor="#FFFFFF"& B% J- F8 F- a$ b6 y
//是否能暂停 (0=no. 1=yes)?  f* Y) b0 [; G# Z6 @- E' L
var pauseit=1
& c" t9 D: p7 h( t+ e( A* i: L2 d
//修改显示内容7 _+ m% y% W* T* C) P
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
5 J9 U3 @# W. ?$ z
; m% a/ \' f2 q2 i5 `; a4 p1 i7 J8 q
////下面不需改变////////////) {3 e: L' v  A  c' M
# b9 Y7 v. Y2 `+ m$ t
var copyspeed=marqueespeed
6 P4 C; B9 ?4 I  A3 Gvar pausespeed=(pauseit==0)? copyspeed: 0
) M& k3 G* E- n3 C/ Ovar iedom=document.all||document.getElementById; N; n6 f9 y* E. X- O
if (iedom)
+ a$ c1 h- L- q6 Zdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')- f& a+ I% h& X4 x& }! |
var actualwidth=''" Q. ]) X+ M, h" q
var cross_marquee, ns_marquee
& R- h! Q) |3 t1 h2 K! T% c
0 U) o+ t; v3 G5 |function populate(){3 w4 k; |8 }  x; _8 k
if (iedom){9 `' w- A3 r2 ~  D  a
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee0 A7 R( e5 }6 t3 c( S! ]
cross_marquee.style.left=marqueewidth+8- h0 T. @1 ~% F+ b
cross_marquee.innerHTML=marqueecontent
& C2 ^. j, X( f# l; wactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth& J# p4 O$ m- u9 o- T
}
) v/ b; C# ]" f) M" r9 F2 Uelse if (document.layers){
! {/ ^6 R$ @5 }. z9 w2 X: ?ns_marquee=document.ns_marquee.document.ns_marquee27 h8 W/ q3 T1 @2 c3 S( H7 b
ns_marquee.left=marqueewidth+81 P$ y' D0 u8 e
ns_marquee.document.write(marqueecontent)
8 C5 O$ r2 Y+ Vns_marquee.document.close()0 p! g: R! x0 H
actualwidth=ns_marquee.document.width9 K& H! `3 G2 O/ v0 o
}
9 }7 _2 }. D2 l. H/ |lefttime=setInterval("scrollmarquee()",20)* H" U  x$ A  v, s/ W! q
}
) @- r) V8 Z' _& x6 d3 B/ Bwindow.onload=populate
/ S% l5 @; a8 l" q# K
- [* Y0 ?9 g3 G& l; U. a3 mfunction scrollmarquee(){
# i% a; S+ |. h4 c6 f4 y6 X" yif (iedom){
$ H$ ?) \6 c! o% x7 xif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))! y  B0 K( \+ ]
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed! C2 Y& {$ a* O  f) ~" w, Z9 p
else
% _5 B2 \" i4 V1 Y4 @cross_marquee.style.left=marqueewidth+8$ U& r8 H4 ?7 b8 u* A4 ]: s: M
( f% n( f2 a3 ?
}" U6 F1 V, H6 B& e0 c' i
else if (document.layers){
8 i: L# H4 N2 ]0 P; mif (ns_marquee.left>(actualwidth*(-1)+8))
. g7 C- Y/ w" S. pns_marquee.left-=copyspeed. `" {  P3 H2 e# i( q7 z
else( P5 o8 i4 ^- `# E& ?( @+ X) J4 X. Y
ns_marquee.left=marqueewidth+8
: Y9 g: m) _$ R. a; n}
9 ^- J/ O2 f% L5 F}
/ g& F* `# f9 \6 s6 s! S! n/ m0 o( T
if (iedom||document.layers){
6 u$ N! J/ ~+ L2 l8 {, Q* t3 h. Zwith (document){
" M' y5 v  S' N! j- ?document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')" u9 D9 q# Y6 ~$ L. v( A, c, R5 W2 ]
if (iedom){1 U+ [1 h: N$ G4 ]+ v
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
1 b5 [8 z+ f4 L/ p  U# d' Dwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
, h2 U7 o& y3 k1 s" p' x$ Kwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 l9 ?& P* {* r/ `8 L3 l, mwrite('</div>')
% v8 u# Q3 ^; K+ b$ B4 O+ Y8 V}
" z, A, H" N% l6 n0 Q! y( s5 ^( {) Welse if (document.layers){
8 i. U1 j+ D0 i. Dwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')1 g/ M* k! ^* N! F5 Z# z& Q% _
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
5 J5 D* D9 P/ ?$ x- |write('</ilayer>')
1 T2 }1 s0 b" c! I7 ^5 s3 F: K5 P}
4 D, g% f: E! B9 Q" t- o$ [: \document.write('</td></table>')
0 q7 ?! ]/ L5 I  }# N# i: t}, l: `( y* D- b8 D/ \
}1 H! j7 ?6 F- j* t+ ]  s' s
</script>

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