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

|
网页之跑马灯文字特效
//修改宽度8 D+ g5 |/ u+ ~+ a% [0 r7 v4 b8 J
var marqueewidth=300
, H+ Q* E3 ]- @( n- Z1 l6 a9 m& @3 {//高度( x7 \: J8 |, [! \. q% Y
var marqueeheight=250 d- G# x* j1 E1 m2 \$ u1 t$ C
//速度(1-10)
3 ~- ^4 F" g7 |7 nvar marqueespeed=3
; v7 x' u, B! e) F$ U//背景颜色6 G i# \0 L5 s* N
var marqueebgcolor="#FFFFFF"" G ? _( G( J# G5 n
//是否能暂停 (0=no. 1=yes)?& K4 W7 S3 z$ z+ S
var pauseit=1& K! k( Q$ w# T; R s+ e9 s7 ]# g+ Q& Q
. p# _3 o, N+ |, S, J//修改显示内容6 F/ ?" ?6 D% z
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>': N* P% W# Y$ F1 e
. `$ P2 t8 a: l* j
& ~! g( ? d1 J) F) t) i2 w////下面不需改变////////////
1 G. k' S' C- s, i* W6 D5 ?& y+ v5 x! [; f2 P1 T3 _
var copyspeed=marqueespeed
5 r: s/ k9 d' P* ]/ K+ [var pausespeed=(pauseit==0)? copyspeed: 08 O. s* l8 w. ]( x) b7 D
var iedom=document.all||document.getElementById
b/ |/ {" k( q3 X7 E9 Hif (iedom)+ ^9 q: K8 k l4 \2 @2 [/ B
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')9 a6 X, L h! @' f/ r
var actualwidth=''/ o5 q6 |. p/ r/ ^$ g! G% k, U
var cross_marquee, ns_marquee: t+ j5 L9 Y# D1 e9 A2 L
3 s, x4 h$ b p' o* V- Q/ ?function populate(){1 N0 Q* Z: N+ ?) [ ?1 W
if (iedom){
) W; V" q }# p, u2 ~; O/ qcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee( x% ~, c/ P. [5 r5 U/ M7 L1 L
cross_marquee.style.left=marqueewidth+8
6 k S3 `( d% \9 scross_marquee.innerHTML=marqueecontent
3 K" [) ]$ ^$ V2 K3 N6 Sactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth' t! g' ?/ u' S' k0 m" t" B2 h
}
5 t8 i' q8 p2 n. X$ j" _1 s2 kelse if (document.layers){7 D' c$ \( \4 _5 h+ T
ns_marquee=document.ns_marquee.document.ns_marquee2; z7 C+ d3 r( \: u/ b. v4 X/ l
ns_marquee.left=marqueewidth+8
. Q# l4 w3 z2 b) h! `ns_marquee.document.write(marqueecontent)
/ W- K6 ^' L: z9 Hns_marquee.document.close()
# @( M. w0 Q9 C `; X+ Dactualwidth=ns_marquee.document.width: J! P; u8 n8 ?2 ~2 A1 p) C
}
' R: @- d: g6 z- K4 s, |, H! u' elefttime=setInterval("scrollmarquee()",20)$ T) x/ `5 P6 k9 A" t( m
}$ Z4 Q9 f5 S7 \, ]9 I8 O
window.onload=populate3 b: c& i# v1 K7 R- w7 a
5 K7 ]" A q# \! J) q- A1 u P% G
function scrollmarquee(){, z8 g$ b4 d% ^, c" {
if (iedom){ R! o8 H' k" B5 i% ^& ~8 ?
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))2 L! C/ ?5 q" O
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
" v& P& G* y/ t" Yelse
/ t0 p4 D3 c7 a6 C, E$ n% p2 ycross_marquee.style.left=marqueewidth+8
; S1 f0 q9 @( v- _' R
+ R' h2 }3 t/ o* g8 Y}
{% L" r( |2 p. d. }else if (document.layers){
4 t6 F5 E: y8 s3 {' ^if (ns_marquee.left>(actualwidth*(-1)+8))
- b( M+ M7 X& Q3 U( J% ?/ ^ns_marquee.left-=copyspeed& [0 X9 r+ U4 J r: g( o% Y
else) _% [3 a# n( j4 i
ns_marquee.left=marqueewidth+8
3 [# e ~9 r/ h}
: K% [( `3 m4 x1 s g}
* b, y* ]5 L" F/ i3 L& {# h
4 D5 n% s. A/ H! Iif (iedom||document.layers){
. M6 n1 Z# N: j2 E" a; [+ @with (document){
& V' Q7 W Q2 i! v& `document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
4 X$ h8 y! ], Kif (iedom){% m0 J" l$ u% i& g4 t8 S
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')& N& W$ S0 I" g l4 h+ B" T3 V% H( w
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'); a; P/ J- \: e& _, _5 G b
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')! ^% g( \: C! r; f
write('</div>')8 g6 {; w. {; z1 I& M
}: u6 L1 w& p6 l! m& h! J
else if (document.layers){6 n) I1 L+ C9 Q6 q6 G# j7 M
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>'), x& N. e- a9 G! P& y% J# ^
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>') d1 ~! e. h7 i8 b5 k- a
write('</ilayer>')
* R% j# x0 n- y, J# j: j- P}# U& A! ^, ?/ q# n
document.write('</td></table>')
6 u$ Q- c6 \9 _# T; n9 [; ]}
7 Z( p4 ^2 I$ C! n, B- j}: t4 Q* u4 Z" m6 B, O! ~
</script> |
|