返回列表 发帖

网页之跑马灯文字特效

//修改宽度$ A# Q/ j2 x7 ~/ O* J, G* F. y1 Q
var marqueewidth=300% z( s1 }; W: t3 D5 Y
//高度  C' o* B9 }( h' x: I* k  \, G
var marqueeheight=251 F% ^1 R; A0 _/ @( h
//速度(1-10)% Q; \6 j+ N6 T2 f3 A+ Q0 I
var marqueespeed=3$ f: G% V' }% s+ _4 X# W) x
//背景颜色
9 m# `& u& G# L" U6 n- {var marqueebgcolor="#FFFFFF"' Q+ E( x7 Z( h8 ?. T
//是否能暂停 (0=no. 1=yes)?2 A# A4 m+ q' j/ e$ `- o% Y& B" H
var pauseit=1" l# J( T6 K. Q8 I
; k3 O. o+ l) i5 @
//修改显示内容* K  O. O- x4 y6 f  F' A! S2 r! N, w
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
6 G. Y  T6 d7 g; }6 ~, G* p; ]5 c* D. s+ J( j  J- e8 e

& _# Q- b! o, g& ]! }////下面不需改变////////////% B7 S3 \" h" e0 m3 {7 G, p- X
; B( S, l6 g/ L! G3 Y
var copyspeed=marqueespeed% [) l" |& Q( J3 Q; S" B$ E
var pausespeed=(pauseit==0)? copyspeed: 0
4 M/ \3 I' i4 s0 p9 `& Mvar iedom=document.all||document.getElementById
2 ~' Y& W1 A, p0 U' Y8 b" Wif (iedom)
4 C( K6 z9 i# D# f/ p- Idocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'), R$ A* O. O4 `* m$ J1 z( P
var actualwidth=''7 e. l* }& J2 j  q6 L" I- J. u7 K
var cross_marquee, ns_marquee6 z4 C7 _. n0 ^3 U; N' s: M

6 Z: u! m  t8 B  n6 J# Qfunction populate(){6 F: {3 z& j& `% w. Y: e
if (iedom){5 e" B9 Q; X5 L6 Q' Q& P
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
" k  }  N. C  k3 ?8 Ocross_marquee.style.left=marqueewidth+8' J" O0 B' q8 `  v4 c
cross_marquee.innerHTML=marqueecontent
. L: @" ]6 t; T1 lactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
: i" [0 [  \( ]+ p3 P( Q}) t  Y) ?6 N4 S
else if (document.layers){8 U. k( l* `% H9 `
ns_marquee=document.ns_marquee.document.ns_marquee2/ Z$ `2 F! X$ |, J- i
ns_marquee.left=marqueewidth+81 a9 `2 q% w* E1 E* b
ns_marquee.document.write(marqueecontent)
6 L) M* z; _0 l  u3 I; l# r' ]ns_marquee.document.close()5 C0 H8 r$ \/ i. ?
actualwidth=ns_marquee.document.width9 P& [9 G6 E' z/ ?: }  f# A) e
}6 |' Z- W9 M! e
lefttime=setInterval("scrollmarquee()",20)
3 Y; _4 w# @- y}
7 I6 e) D; D3 dwindow.onload=populate
; q* h3 A% F2 e/ Y: [% n
! ]: r2 @8 ?6 d8 @function scrollmarquee(){& n, t8 N3 v5 m' T  J; ^7 F, i
if (iedom){
* W+ g5 @& y: t/ ^0 N: `, zif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)). l6 y- X7 z" \1 \6 W" X2 r, t
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
0 ~6 x9 g, K5 _3 \) y9 lelse5 e9 y6 Z- F* K
cross_marquee.style.left=marqueewidth+8
% J0 _  f  e' H' A9 g6 x
' F0 J+ Z- ?# t6 e; G}
* x$ b: K# B, a, ?7 {  lelse if (document.layers){
2 f  `. Z2 `7 _; q& z  r. {if (ns_marquee.left>(actualwidth*(-1)+8))
7 L- N: v9 B8 P* cns_marquee.left-=copyspeed
* P3 C5 o0 b0 U" v7 relse, J2 P/ A2 d& n* A, }
ns_marquee.left=marqueewidth+8+ t4 u( {) w% R; ^2 e) n) ~! T
}& d! i- @! w3 m# _, i- N
}, ^& \4 v, H; a* ^! H
" |. l( E+ I: `5 C
if (iedom||document.layers){2 S/ \: ^- e/ C" r3 Q. i7 [) |
with (document){9 E% U6 h2 c! L3 `& U! L' g
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>'). ]$ N0 s7 ?5 q
if (iedom){: K/ S8 B  @+ c0 A
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')' d, {7 D% m$ u0 m' G
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')" u& h4 h6 N- P$ |# H6 l! a
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')& j! }6 I" }$ {+ N# E5 L+ |/ v
write('</div>')
4 b1 I4 L4 J# n# Y6 R' a}# k# S9 |5 p( k  L. @8 a' Z
else if (document.layers){
0 ~" Y' q2 L$ M: Nwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
9 K' C- q  z/ g8 V( q& kwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
* J/ x. u5 p( C3 r( R0 }write('</ilayer>')& b0 M/ k: O; U, D& f# n% r
}
' v$ m$ }& z/ L; \document.write('</td></table>')" I) @# r/ ^& j
}
( H1 N6 ~- `3 @# i- z) [}2 L  n3 \8 u% G& F
</script>

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