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

|
网页之跑马灯文字特效
//修改宽度5 l, s# J* x9 V6 ?: c" m3 F, h
var marqueewidth=300
. b& ^' t1 r6 f' m$ B//高度: ^6 G$ F( R( S# }
var marqueeheight=25% B& K b$ R. c- Q2 p' z
//速度(1-10)7 l, A: q0 N- Q- n* k$ o% x' R
var marqueespeed=3* r% l& R. }% w7 Z" b* R C
//背景颜色+ K1 g% T. o( x9 i/ |0 O: q1 @
var marqueebgcolor="#FFFFFF"
; t# x/ h& r! s* N# g5 u- A//是否能暂停 (0=no. 1=yes)?) p8 G( C, K; c4 C$ i" J
var pauseit=15 [! Y; j# U, b, e! Z% b9 U; w; y
, }$ N/ J$ G7 d6 l
//修改显示内容6 }5 B9 r |! Y# s* ]
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'/ r1 B$ c* @. }: |( d+ _) y
% A7 d- \8 |+ j2 u# x3 b! z7 O( U, h
8 }6 x8 J: q3 @2 N////下面不需改变////////////
* Q7 q! z; ]' [) O0 F2 T: [+ ~7 z% ]) k' G
var copyspeed=marqueespeed* i- G* A# `- L
var pausespeed=(pauseit==0)? copyspeed: 0) F% U8 H" F2 N8 a0 Z
var iedom=document.all||document.getElementById
( E+ G% ]3 b; _. xif (iedom)
: t- `6 M0 r; A. D. m! q! |5 O1 u2 vdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
/ o) P* O. O9 |- L! ]1 `var actualwidth=''
( y% N2 j; z+ _1 H5 Cvar cross_marquee, ns_marquee
( s: A! O* y# S4 d4 O" n( I* H
7 W) P9 ~/ ]; M8 P6 q5 `- \. Z9 Sfunction populate(){+ T- [+ H; W# K2 d5 R/ c
if (iedom){0 R: ^2 E1 M' M) _
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee2 U V2 E+ q4 I5 |& q" F4 G
cross_marquee.style.left=marqueewidth+8
: V' u: v0 G7 u0 ^cross_marquee.innerHTML=marqueecontent0 v4 @: v, A0 y% q( l
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
8 l" G* @/ s9 c; s& W}. E d: \6 u0 [) H4 F
else if (document.layers){- e6 K/ B q8 P/ u* I
ns_marquee=document.ns_marquee.document.ns_marquee22 B D/ l7 A: o K
ns_marquee.left=marqueewidth+87 d7 t4 n9 }" S) K" b/ }" b
ns_marquee.document.write(marqueecontent)" \; q |+ K+ u% ~: b1 g: R; Z
ns_marquee.document.close()
& f# J" J2 V" O) d* h) ]actualwidth=ns_marquee.document.width
4 z; u8 \1 o8 |' Y: ?3 W M* W}
0 ~/ ?4 u D9 t, Glefttime=setInterval("scrollmarquee()",20)
* _' F3 j5 R! s; m0 L}
0 b' Z2 x* j2 F5 Kwindow.onload=populate# p( h9 W. h! Y/ b
$ ]5 ^5 u$ i4 d8 | B1 M' y% H8 p" \function scrollmarquee(){
' F. r" j5 \+ ], f$ G, }" gif (iedom){
: Y- A1 ~ x9 G) j5 P' xif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))# s# p. ^0 G, @; X$ p
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
, b \6 q9 J2 Xelse
* p' J6 H) R) `! V0 _9 Rcross_marquee.style.left=marqueewidth+8
2 c: F" [; h8 i, F1 Z2 W4 v. h6 M0 T+ K
}9 D1 @- W: X$ S+ [* r. p
else if (document.layers){
! n- e' \ z1 Q- D% ]3 ~if (ns_marquee.left>(actualwidth*(-1)+8)); h; x1 f2 J' V. }5 R) {
ns_marquee.left-=copyspeed
1 c4 S) ]# p d% ^% h! ?3 felse- S- P# {) _4 S6 g! N# F b3 |
ns_marquee.left=marqueewidth+82 w! J( v3 I( H$ N6 @) b2 H
}# Z8 w& C9 v5 X+ j5 S. W) F2 w* B
}
4 U5 m3 ^# u1 e* ~ [ u5 V z
! D5 }9 p% K; \- L% M9 g/ A) @7 bif (iedom||document.layers){
|8 ?% c$ E4 k9 jwith (document){
7 ]7 i2 m$ V' v- q# n) C0 ?$ Qdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
, A/ `9 h9 w/ F- g5 dif (iedom){
+ A3 ?& g1 b5 s1 k% D2 \write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
7 x. C0 C# V# Bwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
& H2 p8 W. O+ e" rwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')) ^2 F Q4 K% _3 q* ^$ g( l# Y7 F
write('</div>')8 b$ S* a! ?# L# v; g7 Z( E+ T
}
6 u6 I4 y0 B- G) melse if (document.layers){
6 V- T* }1 V- Rwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
' K% m% g- [& h3 }' E' Q. {' O, twrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
8 `6 a# c0 n/ b4 cwrite('</ilayer>')
M) r& S& r, T1 k/ K}& P% c g1 q) v. R9 Z, i6 P
document.write('</td></table>')
: \: A# H U( L$ }}3 u8 V' ~/ Y8 }( a: w5 H' V
}0 g+ w% O/ b x4 w/ s' G
</script> |
|