  
- UID
- 133
- 帖子
- 51
- 精华
- 1
- 积分
- 186
- 金币
- 55
- 威望
- 2
- 贡献
- 0

|
网页之跑马灯文字特效
//修改宽度( l$ k2 M7 C0 j' c7 I$ P, @
var marqueewidth=300) r! S0 v$ ?0 J4 H' L8 @) R
//高度- ~* R: [# {3 M* i
var marqueeheight=25% j& _: e. Q5 R
//速度(1-10)
: O6 {! E7 g& L2 d& A* b6 G& Ivar marqueespeed=3
5 w) X) Z' c; G& e/ x//背景颜色
6 k T; x J: C0 j5 ~var marqueebgcolor="#FFFFFF"
2 A( b1 t( V, W+ Y& |- Q//是否能暂停 (0=no. 1=yes)?
. p7 a3 Q- o$ d/ W* [' f7 cvar pauseit=1
6 W+ v! Q3 a8 k ~& z( w' V" N k1 Z4 S2 Q! ]# W) U1 }
//修改显示内容3 m! ~' U, Y8 x6 d3 ?) g4 w) P- q. l
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
% v5 U! L* e5 L. ?7 l; v' O
; N7 B- K+ M4 D+ M7 e! g
! d- R& Q' Z2 M- W. o7 R////下面不需改变////////////' H! Y0 E; i" b! _4 K! O1 _5 X% ^
' Y, \* ~0 P9 L0 w; N
var copyspeed=marqueespeed
) u/ U% l, ^: S$ M: p0 svar pausespeed=(pauseit==0)? copyspeed: 0
[- w4 O: m, q& ?! [) L" x+ Bvar iedom=document.all||document.getElementById- N7 n/ i* p) w! R* H% n
if (iedom)0 f* U- N4 Y! X- m
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
1 d2 D8 j& C) t" cvar actualwidth=''
. {3 ^( z, E& H. T0 ivar cross_marquee, ns_marquee. p5 e: h% ^! O/ O/ _
/ i% p) e6 r0 V6 I2 ^
function populate(){. t# n. E F+ r6 u# b! g
if (iedom){5 j% @. F& m' y5 b
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee8 v b+ i8 Z* v) V
cross_marquee.style.left=marqueewidth+8
0 q7 Q5 m% I5 Z% e: j5 ]+ I9 c( pcross_marquee.innerHTML=marqueecontent
8 i# d, y' ~) k/ T5 @* Iactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
' h @8 N$ K6 z1 ]2 r}6 T1 i6 w# s* @: o9 b
else if (document.layers){
" i: _8 \7 Z! X: e9 f" C) V4 Rns_marquee=document.ns_marquee.document.ns_marquee2; W% P- l) D" F! ?/ C
ns_marquee.left=marqueewidth+8
( G' U, L+ n5 ]9 ~, cns_marquee.document.write(marqueecontent)
; v8 j4 v a9 {$ j# u- [" [ns_marquee.document.close()
" @" q$ z r) y+ N4 j% y8 [- Eactualwidth=ns_marquee.document.width
- e o+ e' q* E1 G5 Z/ ~}
& ?% j- u- s' S5 m8 flefttime=setInterval("scrollmarquee()",20)+ S5 `# D1 S# U& f
}8 A* t) Z: q. Y H3 o
window.onload=populate! P6 O$ s& ^8 Q4 d
( G+ Y8 Z( U: N: |- V# E) m
function scrollmarquee(){! }% t1 F0 c7 Q- c5 p% h+ f! _
if (iedom){
( C' M5 ~/ N! |% P/ d2 R& Eif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))! n- e' x9 C- k* A7 {. @, m. K) L
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
) f" f* {8 c8 r4 z6 N; z, Eelse
" b+ d7 }/ R1 P! H9 `- L8 Xcross_marquee.style.left=marqueewidth+87 T! H3 _7 R" I+ l' S0 ] o
9 w3 q" E8 J8 ^; T
}0 | _: ?- n0 i0 x* s
else if (document.layers){8 K4 A6 Q' H; Z, ~5 R/ e
if (ns_marquee.left>(actualwidth*(-1)+8))+ A8 ^0 | _7 ^2 R' U, b
ns_marquee.left-=copyspeed
2 V$ b' W, I. w% C3 j( uelse1 J" Y4 ]8 W- L) r# S1 t0 b
ns_marquee.left=marqueewidth+8
& Q! w, Y( U) u% L7 U3 }}
: ~& f1 i, B, ?}
+ J* `+ i& o {4 {) _$ e0 E6 h: @" c9 w$ E1 ~' p# a
if (iedom||document.layers){
! _: C! i$ U& ^# pwith (document){0 L3 z8 r* T$ y" D; Q* J- \
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')+ x+ l: N7 r7 q4 V# s3 [9 F
if (iedom){
/ N/ A* t3 a6 Mwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')) `5 X! V! h! V" A$ ^. F. X
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
) T* `/ U1 l6 X5 I' dwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>') w E6 V# k5 p8 c3 [
write('</div>')& b* O* z1 W' o
}
( W! A! Q& q2 @- B5 N& T( Velse if (document.layers){
* {1 u; g0 _* c: ^. c/ ewrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')6 _1 Y: @8 r% a
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')6 n' {, z7 U9 N$ `% c5 F
write('</ilayer>')
8 B; c: o4 X0 v, L1 S( b3 n}
! D# o: A$ D( V' {% ldocument.write('</td></table>')2 S! ]5 Q m2 s( c, {
}: v: V! z( s& t$ [. ?0 p7 l
}% _# k% x. z* I
</script> |
|