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

|
网页之跑马灯文字特效
//修改宽度
" J2 P5 @$ d# U) o) r2 k! Vvar marqueewidth=300
# N+ s! _, I( @3 O' d//高度, ^- M- C8 p3 v3 N
var marqueeheight=25: ? p) ?# G' i
//速度(1-10)0 C6 z6 o# _& h' \. L
var marqueespeed=3: J$ X3 S2 u& o
//背景颜色
$ C. ~ g. h @" Vvar marqueebgcolor="#FFFFFF"
# H8 B9 C' U3 _" }% Q+ v//是否能暂停 (0=no. 1=yes)?/ ~: H: ~4 b5 X* q# _
var pauseit=1/ s* [; C. @2 L
R: g1 x! ^3 i# x4 g' P
//修改显示内容
+ N- D4 R' c8 ?# N. K5 Wvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>') o2 Y$ x. l. M" g2 u1 A
& S: W. Q7 `# c8 l7 [8 n7 a3 r7 C$ o
: M, x0 s$ B8 N/ r7 z+ |9 |/ f8 h% r& [////下面不需改变////////////- S( T1 m/ h6 ~" H! ^* g. Y
- R; S9 j v r0 a# Kvar copyspeed=marqueespeed
3 ~) |: u5 c# S2 K1 S) A* u6 ~% Zvar pausespeed=(pauseit==0)? copyspeed: 0
1 D. A' \: b ^var iedom=document.all||document.getElementById2 i7 Y" a) d! z0 q% B
if (iedom)# y; l: k, T5 D! `; x4 J7 m& m' d
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
2 k6 t6 A4 z+ g" x& ivar actualwidth='' G6 b: y2 L" b4 W
var cross_marquee, ns_marquee
0 Y. ]5 x( }/ W9 {) I% z6 C& Y# x0 {5 W! v# |0 y
function populate(){' m1 M9 Y0 |8 H/ d* ~2 [# Q' V# [* a1 O
if (iedom){
9 f) J# ^1 p. o- t1 l& O' {$ r2 Kcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee3 R8 T; O2 [" D) c$ z
cross_marquee.style.left=marqueewidth+8
( N# _1 U v: @' v5 T9 Zcross_marquee.innerHTML=marqueecontent
# N3 H* Z1 Z0 }0 Yactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth3 [" a- S) I3 O* `2 S
}8 g0 ^. D+ ?$ [2 E" }! y4 I
else if (document.layers){( `# s( }9 G# F) z7 s
ns_marquee=document.ns_marquee.document.ns_marquee2
, X$ F; I6 d: Z4 C8 i V6 Ans_marquee.left=marqueewidth+8
4 U, {$ G1 g! Sns_marquee.document.write(marqueecontent)
2 Z- C' J! ^: P9 R0 ?7 j% V+ ^ns_marquee.document.close()
7 p# u( [- {+ o& U' S g7 \actualwidth=ns_marquee.document.width
: W( d5 c8 Q0 A% q1 U2 i" s}) Q2 I1 P# i i: w a
lefttime=setInterval("scrollmarquee()",20)
# a1 ?0 e) Z, [) ?& l$ N+ G}
. g4 \. ]% c" wwindow.onload=populate
' O+ z* u" X" `; s# ?. C1 ~
[* K) j! Z" f" d+ t5 c" nfunction scrollmarquee(){2 Q1 Q4 C1 ~$ b" H t
if (iedom){5 l( ]0 `9 j. K; I& @# e1 z
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))& {+ U) v9 }) L" Z: U( z
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed. b. I; r0 o) o1 a3 K4 X! b% Q
else
* n# x* R: c) ?) E; l$ r- o' xcross_marquee.style.left=marqueewidth+8
# L0 T% ?0 } `6 l$ p+ W/ i- m1 T# L( q. m+ x8 `* J
}' `6 }( L( e5 M) Y1 R0 v5 l. Y
else if (document.layers){
/ c8 Q! x! t+ B; d- zif (ns_marquee.left>(actualwidth*(-1)+8))
4 n6 {. b0 P# n/ F( Cns_marquee.left-=copyspeed! @, H& K1 {* k: O+ [
else
2 O% u: E* x+ k) c: {' }3 {$ Kns_marquee.left=marqueewidth+8
! E6 ?& J5 I8 q" X* b8 z; M}2 {6 n$ _1 |& O* i- A
}2 g" l3 d- t1 N; t5 a; n
+ d" k1 G. C* m1 W; _% ^+ I# G
if (iedom||document.layers){
2 @# f' U, i1 t) _with (document){1 b$ ]4 S) n& V6 s! `$ W# g
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
) F/ v% {3 v: L# V8 Y+ Sif (iedom){# x" p9 z h! Y
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')& a9 X4 N& X, @' f2 J7 F6 n/ ^2 n
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
9 L; h9 R1 a+ H( M6 Fwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
, y6 s" j9 W& i" p9 G4 fwrite('</div>')6 v9 h' \0 k$ T
}
, F, m# o4 a( x( ]6 Relse if (document.layers){
8 y0 {! g6 F' J) J2 _3 jwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
- k/ D. r# }8 r% e# ~) f7 owrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
4 j) ~! b" p- y. \- y' M; lwrite('</ilayer>')
F4 S- M0 b8 `7 l- |}
8 d2 k) [) A3 O! }! J1 hdocument.write('</td></table>')8 \9 g( [. U5 }6 X+ V1 }1 m
}# p( ~# o. i7 y
}
1 ~/ Z8 y+ K; V* E) y' d</script> |
|