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

|
网页之跑马灯文字特效
//修改宽度 ^4 P! ?; m: A9 k/ o& B
var marqueewidth=3001 A- {5 G; }$ z& n
//高度
9 P% c7 v6 R( t- X+ P2 q% yvar marqueeheight=25 k+ B b! r+ f/ C7 T. h
//速度(1-10)
9 f6 p2 l# B, k" X0 v' [3 S; Bvar marqueespeed=3
, ^- X) X1 X) t. O9 Z2 T//背景颜色
- I+ H/ j* g# ?* ?" `9 b9 m& e. j( rvar marqueebgcolor="#FFFFFF"' H7 C9 ~6 I0 ?7 c( E& P
//是否能暂停 (0=no. 1=yes)?; s! T3 M3 C' q! X, a# k8 H3 W
var pauseit=1
% u$ ]; h4 x- z x$ g$ c& ^$ g/ ~
//修改显示内容 b- i+ p/ u3 U/ t9 t6 i" l
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
2 g8 B- H" q5 i! C1 v" _" I4 X2 q/ Y1 ^9 e; ^
7 c' Z0 h3 f& i R1 a" E+ I
////下面不需改变///////////// m& T/ X* P. y. D8 R
2 R$ d# G4 L: l
var copyspeed=marqueespeed
% O# I4 O& r% V0 }& C- v# V- C1 \var pausespeed=(pauseit==0)? copyspeed: 0
3 M8 y7 T, p3 _var iedom=document.all||document.getElementById
5 Q( Q" p( b* M( A; Eif (iedom)$ E. _: H% ]. |9 K. S7 r
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')/ U/ D' q& q! Q+ Y
var actualwidth=''8 `3 V! S! ?9 P) m/ o# _
var cross_marquee, ns_marquee
! P& @( t6 N6 `6 I0 Z0 A9 [
5 z: ^! j! V" Z* D& z/ p/ Ofunction populate(){9 C7 ~* D3 d2 W7 i! p
if (iedom){
2 H9 ?( Y7 ?$ O1 p1 P7 q$ K! Gcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee& ?! e) k" Q' b0 N; O$ o1 W7 L
cross_marquee.style.left=marqueewidth+8
* U9 @1 ^( _$ q# y/ i7 Ccross_marquee.innerHTML=marqueecontent
+ J! P0 P, o/ H6 nactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
6 J9 Q% K$ E5 m+ N" v% l6 ~; j}
4 j- a* D8 J: xelse if (document.layers){
! x. R0 F# j6 Z! X* _ns_marquee=document.ns_marquee.document.ns_marquee2
2 |1 Q5 {: t* R0 `ns_marquee.left=marqueewidth+87 S9 _ z, J K' M7 z9 X- G
ns_marquee.document.write(marqueecontent)8 o9 V4 ~* J! G# g0 f9 a4 k
ns_marquee.document.close()$ I, r# y( G, n/ Q5 H7 `: Y
actualwidth=ns_marquee.document.width- f) F# C1 p( D
}: Y: s) f1 s6 s3 T
lefttime=setInterval("scrollmarquee()",20)
' B0 d. V& V+ b) \+ L' G/ r& r3 |, b}3 |3 i' Z @. @% I! H5 F" _
window.onload=populate8 U$ |' O& C4 S* b' I0 J9 K- o. p
' L5 t* d7 R: p2 ]1 N2 H6 {4 e& \function scrollmarquee(){
( r5 o( a0 o' ^! ~8 U% j, Hif (iedom){ Y+ ]3 k0 [. I0 N4 j! y" B
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
" ?! p* n; m( H( ~cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
% f0 Z* l8 H9 F- t9 Ielse
* K7 Z* ^; Z+ I$ W, L& Across_marquee.style.left=marqueewidth+8 t5 S; z# e9 L$ `1 g3 ?9 c5 c
) D) H: r+ q" F3 A$ }5 M& j
}
0 [6 j3 ?4 W# m/ S& Lelse if (document.layers){
: |0 x! l" o2 Lif (ns_marquee.left>(actualwidth*(-1)+8))
/ }/ T/ q; ?$ w9 O- g% N, y2 kns_marquee.left-=copyspeed
( ]# i" D, p' P4 Ielse# q# ^* |0 `3 Q, m( O( ?
ns_marquee.left=marqueewidth+8
% y* h0 ?6 S" G! X* Y}
) W' R" w; t& ~2 ?% T}/ Y' z: g& T ^2 a3 d
! s% O- l# }" b' \4 u. Fif (iedom||document.layers){) @- u; v) J6 Q4 B8 E2 W& \" O- T6 W
with (document){
/ d R% m) N: @8 S5 Zdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
* d* j2 S( j7 @) x6 c. lif (iedom){% o3 }& M2 F# h( `
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
; h. N G* A# U9 y$ S `write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')8 m& U* \$ o9 r6 [# E. }3 ]
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')! }4 S- v! ?: \, ]
write('</div>')- T) |' P2 w( u) q
}% j% j+ Y( ~5 d% f% F& x
else if (document.layers){. Z* N8 ?4 k! t% L
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')) q3 G3 @" ?' M* o
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')3 `. ^$ i8 h' B: ?2 g
write('</ilayer>')
' h" p/ R1 m% b) u1 k+ W) L}) h& n, K# c! l2 Z
document.write('</td></table>'), ]4 s/ \1 [: v
}" N" o# {% H: w+ p% D1 d6 F
}7 R; U$ D0 c b3 K' z3 ]: h4 @; Z
</script> |
|