返回列表 发帖

网页之跑马灯文字特效

//修改宽度
( H( \8 \; W( ?" K8 svar marqueewidth=3007 \& }- U  D! s$ s7 Y
//高度
$ Y% M- f- k# W/ w0 Wvar marqueeheight=25
, Y' Z" f4 U. U1 `" j//速度(1-10)
6 _1 T$ u* G2 l- Lvar marqueespeed=3
/ F, c7 L$ Q* N2 K( o0 f0 j7 L//背景颜色5 l9 ]" o+ x8 z( I/ m
var marqueebgcolor="#FFFFFF"
( A8 ]" ^1 c% {" P) P//是否能暂停 (0=no. 1=yes)?# {+ P7 v* `$ d% F7 D: t4 a- `
var pauseit=1# h5 I$ v5 q6 C& z1 w  K
  ^. z7 O5 M, r5 k  B& u  K
//修改显示内容
/ _. E3 l' v& Lvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
; C" z( i9 s/ L8 G& w5 d) j8 h
/ \& A4 `- \+ m3 ?+ p0 H( \/ g/ s
////下面不需改变////////////4 J3 p% W( e8 D# c  v

) [% f; S, H$ F7 ?, Zvar copyspeed=marqueespeed
: b, P; D% n. j$ {var pausespeed=(pauseit==0)? copyspeed: 0
9 g6 g; {4 P! \1 c0 R, tvar iedom=document.all||document.getElementById3 m0 t. g6 X6 G  c  x- j
if (iedom)7 f; L! h* u! ~6 @: M# {) y
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
0 O% c! p0 }6 L1 h/ hvar actualwidth=''
  P& j' G1 m6 ~. a, j- O" m9 M% Yvar cross_marquee, ns_marquee- E* k- c( e0 x2 o- l( j

) s4 m( y3 n! {function populate(){- N: M% G. K- Q3 q
if (iedom){1 n3 g# q+ Q1 C: k
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
% h% x( v8 ~% L# Across_marquee.style.left=marqueewidth+8
+ {) q3 S( w& S; {# {! k1 bcross_marquee.innerHTML=marqueecontent+ b# m- s$ v1 T/ G9 s
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth4 j) j1 c, h+ M8 N9 ]; B. G& e" [
}
% _1 d1 l! A! \* [$ }6 n* @1 }else if (document.layers){
8 c( o6 E, a) v( _* h5 r; V" t1 ~ns_marquee=document.ns_marquee.document.ns_marquee2
. V3 y$ S+ r+ @ns_marquee.left=marqueewidth+8
3 o( t/ v# Z, Y1 H- B+ B1 Gns_marquee.document.write(marqueecontent)8 ^2 P, e$ l+ `3 Z, _3 H! j
ns_marquee.document.close()
) B3 c  J/ A/ ]actualwidth=ns_marquee.document.width
( u3 R/ }8 ]: }' c5 [' f4 H% x  u}
. A% [8 K9 ^4 S) M# a1 Y+ Zlefttime=setInterval("scrollmarquee()",20)! E/ ~- d; C- O, |: k  [
}
6 \/ M; ~+ o7 r5 I0 [  F; Zwindow.onload=populate
, ]9 h5 g- ?, j) B) I0 W4 d
5 ^2 r% \8 v, o& E$ e5 Pfunction scrollmarquee(){
6 Z' x* n: J2 e5 zif (iedom){
9 K. M; \8 Z3 E8 lif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
. T" E: E! f0 Vcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
- I1 t) s$ c, ]else
0 \0 M# g+ [0 D0 {$ `! e: t% Kcross_marquee.style.left=marqueewidth+8
  s# W& `* u9 g6 S1 t6 }. d" Q# B2 _: U
}" B' _  P. x0 |* s5 S; ]  i
else if (document.layers){( k% s* T9 a8 W2 j
if (ns_marquee.left>(actualwidth*(-1)+8))% E, v- g% {+ |
ns_marquee.left-=copyspeed
# u5 f! ?0 n0 n9 m" g; V7 Qelse
- V  H& `1 `. |$ @) f0 G% kns_marquee.left=marqueewidth+8$ r8 t: ^" R! I, B; i( j
}# w& v% v' ]4 H0 X( I" Q7 ?
}1 D3 Z& ^1 B5 X4 ~
7 R% w' z; J/ j; |; M
if (iedom||document.layers){: }9 j7 ?$ _# o( ^7 {0 B, m; O& l
with (document){
* J; Z$ O. i& z6 F6 E: Y' Hdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')/ u) ^, {1 u- C
if (iedom){
: H6 [" B$ t( H2 a. R2 Fwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')6 x7 _* d5 d6 `# ?- M
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
. w% K! b+ }0 `; i; y/ I! ]write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
6 w0 T' y2 r! \+ d- N+ swrite('</div>')
: o3 ]9 H5 f% w+ y; [' v}
6 M8 N% o8 o. ~/ q) velse if (document.layers){  n2 I1 T" {& i* y* r  y8 Z8 |/ H
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')0 a+ E& b# h5 F- Q- k- }: N- v
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
1 t2 `0 \5 W4 ?+ Fwrite('</ilayer>')/ z) s$ L7 H# v5 d6 s# y9 y
}
; E* Q- _  C* L; ^document.write('</td></table>')  N- h% I6 D& w+ k7 d
}
+ F* s8 n* u( m. s9 S}$ h# Q5 O6 Y, @$ G( e
</script>

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