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

|
网页之跑马灯文字特效
//修改宽度7 }+ w6 U$ s: s: K& j* d% h2 y
var marqueewidth=3006 I/ D" G& n3 a2 p
//高度
( z& j7 X( W, @/ B4 ]2 f4 Evar marqueeheight=25! `- t! V% y) [3 N
//速度(1-10)8 y s# _6 u( {: z
var marqueespeed=3
" O! M) h& `9 e$ W4 E6 [//背景颜色
% F- {9 |* i) S$ u( d- o' fvar marqueebgcolor="#FFFFFF"
( o3 F& j9 t' g$ G//是否能暂停 (0=no. 1=yes)?
- s* y6 I: ~1 gvar pauseit=1
& Z4 G7 H: X. B' s0 m/ K
* j' \0 h8 K, @3 c//修改显示内容
( I* i, @) p5 n. _: Fvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
& q. e T* d d( P4 J6 Q+ A# Y7 h% W% l
$ y" ]! i S% Z/ i: k////下面不需改变////////////
. |, E) D0 B+ J/ W* F! v$ _- [$ K/ I) L. `' @* e
var copyspeed=marqueespeed5 S. ~2 ^) w4 x# @/ Y# R: l5 e4 K- n
var pausespeed=(pauseit==0)? copyspeed: 09 d* K, ?6 f# n; G7 {, F6 @
var iedom=document.all||document.getElementById( v' g/ a1 H r7 b0 R8 Y
if (iedom)
1 {) Z) H* P$ c' {document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
( O4 k5 Q1 n, Svar actualwidth='', ^7 n0 q1 R# ]7 c# n* p
var cross_marquee, ns_marquee" n7 J# f5 }, ^
6 c6 z+ S' s. k* `" r9 S2 ffunction populate(){1 ^$ x1 L7 `6 @& n) H
if (iedom){- d8 Y/ H4 _; I0 P
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee) ~5 X# S. M4 q9 @$ @: C$ O
cross_marquee.style.left=marqueewidth+8+ x% L+ N, F- `8 A
cross_marquee.innerHTML=marqueecontent
3 n) _7 c- v( l: Gactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
- o$ _- R- ~8 M}
) E! s E$ l8 r2 ~6 H. x9 Melse if (document.layers){( L& C/ y. ^2 V9 g, O% B
ns_marquee=document.ns_marquee.document.ns_marquee2. L9 Z: A$ ]9 v- n/ p. @
ns_marquee.left=marqueewidth+81 G. h% j& Q3 E; b ^; Z# L5 n
ns_marquee.document.write(marqueecontent)+ d/ j3 H1 E" {$ v% B, j& r
ns_marquee.document.close()# [: T5 b6 j( W" d0 q" I6 L
actualwidth=ns_marquee.document.width
) S1 X6 a- G: A% m}: B# v; n3 m& c: J7 a+ ]/ V H
lefttime=setInterval("scrollmarquee()",20)3 }, f6 _6 G: J+ J. `$ S* |
}
" Y" _# K/ P( e$ Jwindow.onload=populate0 C6 o' d1 y6 m
, A% r6 N, _& h7 L8 V) s; j
function scrollmarquee(){
$ E+ [- M, P4 tif (iedom){& N' y; y) v, V4 m. r3 \# A4 T
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
3 B- ?3 g& B. f/ G6 X+ Bcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed3 r5 N; f* G2 _+ ]! a: e2 n
else
# K! O2 u7 i. H7 X* _. {- ~" K" xcross_marquee.style.left=marqueewidth+84 h. v/ [$ ]: F# {& S/ U2 L
* x l6 u0 [/ ]. U* }9 m
}
- ~1 Z9 S" P6 velse if (document.layers){
/ S$ l1 l* s4 yif (ns_marquee.left>(actualwidth*(-1)+8))
3 q) B4 M5 z- Tns_marquee.left-=copyspeed/ `* q, _! q& t$ V
else) m) U8 u, i6 t3 l
ns_marquee.left=marqueewidth+8. B/ J2 w8 E& d# E$ L! w
}
g9 W0 h5 C9 x+ Z5 B}
( w, Z- n% K( e* G) p, m1 r
; ?4 G+ W! f4 wif (iedom||document.layers){
+ @ `6 U0 z: c8 J6 ewith (document){
7 }7 J! T# s1 p6 k& ydocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
" t, h2 b+ W M! yif (iedom){/ \% [6 a* R. l
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
1 x Z! t. L$ f' p: ]write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
6 V5 W/ Z+ ^, pwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
& q, s4 b; A) _$ Z+ `) Iwrite('</div>')% t5 X2 @; {2 y1 @( P$ I( b N+ I
}
+ R$ d& A$ d' _7 ?8 Felse if (document.layers){. K7 K" x4 v M$ D: A9 q- l
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')2 O6 C% P7 G4 {
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
' ^: Q8 X1 H4 B) n+ dwrite('</ilayer>'); o V3 m( h1 t' _( e& c' F7 d3 z
}
$ w% J2 p. s3 Q: Q, }document.write('</td></table>')& U0 H; Q- u* W. q: z+ i! f; t& i
}
8 T. S9 Y; t. H# S}
J/ ?8 @& ~ N3 B# @0 I, I [" s/ w% ^</script> |
|