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

网页之跑马灯文字特效

//修改宽度
; c/ L% c- S  }& nvar marqueewidth=300
) I, o  g! ~$ M- g; i//高度
2 p( _. z" }% g8 w- Zvar marqueeheight=25" l( ]. R& q" J8 z( C
//速度(1-10)
4 s' x( g9 G" A8 V( Y8 o% Yvar marqueespeed=39 K7 D* k4 f; t: k; s) m8 u% q
//背景颜色% E/ {* ^2 A4 y, A) \, {6 n
var marqueebgcolor="#FFFFFF"
8 i) H" k4 y2 u, x9 Y: r//是否能暂停 (0=no. 1=yes)?
# A8 |, n' q! W7 S4 z, S, Ovar pauseit=1
- C' M1 `4 ~- q% j4 B# H8 C
' d; t% O! W% _  w" h, _//修改显示内容0 W8 a- F+ n1 \
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
& m' I, M. D( f5 ^+ X
( V- T& Y: c2 @! I, P/ B7 n
0 s6 `# s0 z& |3 m////下面不需改变////////////
% s9 i  M7 P  d$ u
! }! n, ~# g7 d( k2 r6 lvar copyspeed=marqueespeed% o: S3 V, I% p' L
var pausespeed=(pauseit==0)? copyspeed: 0
5 |" j5 V( R6 S3 e% ], K# V# tvar iedom=document.all||document.getElementById
4 Y7 Q  k  D. o5 yif (iedom)* l9 U1 v) T  u: U3 c' \
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
. _7 q5 y8 K) ]( ?7 w2 G5 c) avar actualwidth=''- e7 X7 I/ S' F3 b0 K3 r
var cross_marquee, ns_marquee
6 t, ]" |/ j/ Q" J* B
; a! a6 z7 }+ x/ N! P' u% e* `5 d) {function populate(){
8 `* f9 u% c/ {6 Z  rif (iedom){# j( B+ q% Y* n& M! m0 @: B& _
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee/ v- j3 H" D! j2 v1 q" ~
cross_marquee.style.left=marqueewidth+8
/ ?2 A/ S6 L+ ^# }* S. kcross_marquee.innerHTML=marqueecontent3 V) V+ }  N9 L! \# J. V- `5 h" P
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
6 B- z$ X1 B- a9 C- a1 c}" A! I* O5 c- Y+ X
else if (document.layers){
$ L' z* K% \  l5 V, e2 a! Ans_marquee=document.ns_marquee.document.ns_marquee2
7 r4 b* ]) ^" p% u/ ~! z! T, _ns_marquee.left=marqueewidth+87 P8 W  c  q3 }0 H
ns_marquee.document.write(marqueecontent)
  A$ J8 S8 X+ vns_marquee.document.close()" ?5 Q0 w( ^: [# u2 X% U4 ^( A
actualwidth=ns_marquee.document.width
( b+ K) }+ ?" ^5 C}; a: K+ t/ W5 u) w$ L
lefttime=setInterval("scrollmarquee()",20)
3 W6 q. W" H, G4 C0 ?/ Q}
* `3 H; X: k$ d4 S2 Qwindow.onload=populate. ]0 _# b$ z% r

- ^: v6 `7 G& ~/ _- H2 K  qfunction scrollmarquee(){' R" c; d% a# Q3 p& k& f
if (iedom){+ \+ {; f) t5 H/ F
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
8 n9 |% }* H! r7 O) Y; bcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed. q/ ~$ [5 r2 D" m0 t5 B8 d; A
else
" a- x! G, T# _cross_marquee.style.left=marqueewidth+8
+ p1 j9 F  A) h3 X& r, R/ S! n% n7 ~3 K8 _) X+ S
}
* I2 l* I0 C+ Q9 R7 k+ \6 ?- C" Celse if (document.layers){
0 _8 b5 r6 _3 P- Rif (ns_marquee.left>(actualwidth*(-1)+8))
' s" s6 N7 o* ^5 Y' sns_marquee.left-=copyspeed  v; j1 v% [( H
else
2 k: ?& o7 J! c" Cns_marquee.left=marqueewidth+8
# b4 e( P- w% d. p/ Q* u}
- C% f+ [9 Q5 |+ `) ~}1 y$ c1 G' s$ w3 h7 [# h$ N. O
" Z& Q# y6 Q) V. p. p4 |7 d* n
if (iedom||document.layers){
8 `" q  Z( B, pwith (document){
% ^' ~1 L) s6 p' I2 q. {document.write('<table border="0" cellspacing="0" cellpadding="0"><td>'); r* Z3 Z# j" R! C; o: T
if (iedom){
7 C) Z. {' m' d) E4 L1 hwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')! i7 _% A% Q9 g" V) x: I- }, i
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')+ K) |' |5 f) i. S/ ^) l9 h& ~( q
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')2 {1 C% a) C5 }' w* k0 N
write('</div>')0 M- K- ]1 w6 y/ k1 P  A0 ~
}
; W9 f5 b  ~' x3 U, J- Pelse if (document.layers){
8 t4 d7 i" Z* q8 x, I- i% \write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')) `- A, }' s% i8 s0 i
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')$ N( u3 O. d. D
write('</ilayer>')2 B1 G# m; P$ p
}1 F0 q% m3 h( c* [0 X2 J0 H
document.write('</td></table>')
; I9 D: h) C, `' e3 K}$ a! Q6 W2 }3 B1 @3 H9 q
}! q) w7 T. C9 l$ h
</script>

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