返回列表 发帖

网页之跑马灯文字特效

//修改宽度/ h7 U& E. R% b8 |. U4 s, `
var marqueewidth=3007 ]4 }4 _9 k4 K3 A5 v
//高度' {4 L( H8 y* @+ @
var marqueeheight=25
3 e' `4 j: o0 c' a, F5 Y) d9 l: O//速度(1-10)
" [5 `/ f2 r" T4 V4 J* Jvar marqueespeed=3( S* M& c' G) A  v
//背景颜色0 ~0 }4 Y7 U* z0 F# c2 O
var marqueebgcolor="#FFFFFF"# Y5 \( c% Y! M7 J: a* G& A
//是否能暂停 (0=no. 1=yes)?
- u' `& D% \# m  x" n* Jvar pauseit=1! S% F7 V7 E/ B
+ t5 f3 M' t% a8 O9 L3 [( F9 z, |; @
//修改显示内容
4 V; x: F, `5 P# i+ m  h% Bvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
7 U4 q3 e2 s! H
/ f  Z9 |; `. }6 ?$ i: \& p
7 d$ B5 [6 J4 f# [: X6 |. ?////下面不需改变////////////( H; V9 t: S$ n: c# J2 J

  p% [% c/ f1 H. K- z; Evar copyspeed=marqueespeed  J8 N* W# N( [& i
var pausespeed=(pauseit==0)? copyspeed: 04 l4 c4 Z/ O" W( M& ?* ?5 z
var iedom=document.all||document.getElementById# h8 V! ]: r  n6 \; l% S- r
if (iedom)
( ?2 [$ [; ?* D' O" O6 Udocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
; T6 v8 z$ V1 k1 |var actualwidth=''& {1 V+ m+ d  A
var cross_marquee, ns_marquee
. Q" P3 n  r1 G# l6 V$ S2 v
" y, P6 a( ^. V+ Ffunction populate(){& N4 }6 S- r! w
if (iedom){* F6 W. p1 `* O: Z5 S# E$ b
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee* R% w9 R) U- I/ @. h* a
cross_marquee.style.left=marqueewidth+8
/ L3 y# t* T* M) `/ ecross_marquee.innerHTML=marqueecontent
! x0 Y  r% \4 b0 c! f& mactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
( S. U1 j! r  A& C}- ]: Y! ^1 W! @; W8 b
else if (document.layers){7 F0 m: A8 ^8 F: j7 y
ns_marquee=document.ns_marquee.document.ns_marquee2
/ F9 J' F0 A$ ?1 Z# ans_marquee.left=marqueewidth+8+ ]9 l5 I# k2 h% P
ns_marquee.document.write(marqueecontent)
! p! Y0 O% [3 C+ |5 Yns_marquee.document.close()# g: }6 a8 U! Z% x: Y/ H, W
actualwidth=ns_marquee.document.width% x% {+ i! G1 c; {( V
}
* n/ \/ q+ Z( y1 M' x# clefttime=setInterval("scrollmarquee()",20); j% X0 N3 P5 `6 N! Q3 \8 V. K
}* _: \6 K# D0 E
window.onload=populate
+ i  D4 v  ^3 D# `
0 d0 m* o$ ^: }! S/ p1 w) o8 xfunction scrollmarquee(){/ ^+ c) t6 l; m$ D( z
if (iedom){
" M8 W, z+ P: K' pif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))7 ^% o* Y5 M, n# Q8 k, S- ]( |
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
; a/ @; i5 C, |2 qelse
  f' T  v3 J* C1 ~cross_marquee.style.left=marqueewidth+81 H' S# T' B. i( R6 W* z

8 s- q+ K; p: P4 I  {}3 t$ f" B0 j. A! u2 _9 r( g, @# r  d
else if (document.layers){
+ ]: W" E0 @2 C. c) ^: v1 Hif (ns_marquee.left>(actualwidth*(-1)+8))1 K+ T4 d( k, C, \0 P2 V, F
ns_marquee.left-=copyspeed
5 H! `2 s. ?9 Z* Nelse* ~; Q9 B0 }6 X* H- r9 d
ns_marquee.left=marqueewidth+81 e, B: c  T3 F) F  o
}
( h) {# m+ y; E( K5 I) O- `}
. @3 `: ?# R( ?" v( o# ?) k6 s7 W' l4 J' N1 z1 I) R
if (iedom||document.layers){- ~  M  M6 \# d3 T- Q
with (document){
3 n, T) \8 E/ s; kdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
4 t, R+ F( L- D: b. Jif (iedom){
$ o# u) L2 ]- Zwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
  y) S. h: x1 B8 ~write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')2 B+ d$ R- Q, a# }
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
0 N- j* D4 k3 }4 E5 E; R8 qwrite('</div>')$ \2 u5 S7 d' S
}$ s. h' k5 A" m; l
else if (document.layers){3 c7 U. [( I3 {+ Q5 E1 T8 B
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
( m8 j/ S3 Z5 {, N# P( _0 awrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
4 y: o* F: u  E, Xwrite('</ilayer>')
  a, T( [; N" x: D% P) f. N}9 s5 ?% ^2 o3 k1 o9 S2 j4 x! E
document.write('</td></table>')
+ l. B7 f5 d- C* U9 m7 a9 V9 J}
# ?8 h3 H7 ^+ F' i3 _4 B}/ r% G$ L4 y1 D% F. W, T  B; M1 @( J
</script>

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