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

|
网页之跑马灯文字特效
//修改宽度# B3 v/ k3 i% ^
var marqueewidth=300: D7 r0 M3 Z" t# I3 I w
//高度& T* e4 ~3 C% i, b4 {% e$ t& s# M
var marqueeheight=25
$ D! u4 [2 `! a% S+ g//速度(1-10)
+ `6 p+ k, f7 }0 c# d$ u0 pvar marqueespeed=3! H E. J ~% d& V) L& K: _# h" H
//背景颜色% Q$ j: x' [2 p- d: [' h
var marqueebgcolor="#FFFFFF"6 M& l2 E& J, i% M
//是否能暂停 (0=no. 1=yes)?
# ~ i+ W( t( z& @: S$ u! lvar pauseit=1- i8 R! J7 N' E$ x
* ^$ [' G# o. g) Q//修改显示内容. Q7 k @! R4 E B
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>', t4 K+ d! O; Y9 h' n6 W
5 S. b9 [7 c5 K# M$ R" E# Q X, e; v
////下面不需改变////////////
; t# Y4 W! U7 O4 l; y! M7 H: W6 q8 {
var copyspeed=marqueespeed( E3 X- ]; G9 `; J$ q
var pausespeed=(pauseit==0)? copyspeed: 01 K& R) Z: b% j m% Z6 q
var iedom=document.all||document.getElementById2 ^! I4 P+ N& ~& C& x( J
if (iedom)% P; _4 b1 e1 m S& [& r
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')' x; x: O9 Z+ R
var actualwidth=''5 \, J0 Y, \; e. P1 u: R
var cross_marquee, ns_marquee
: m' \8 D4 o+ ^; L' O3 b( |
, }) _+ J! P9 A4 d4 J7 O) c9 cfunction populate(){
- Q* z) U. g( i6 B/ B' n+ ?if (iedom){7 e2 q4 w: Z8 n5 L
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee H( d" _2 X, u7 B, N' T! |
cross_marquee.style.left=marqueewidth+8
; I; V ?: `& y. [, {cross_marquee.innerHTML=marqueecontent
3 T+ j( [% [6 H. N/ x0 A4 k" Dactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth0 l6 B n- h- @- P4 r
}4 ?9 v, ^0 `. ^ k7 X$ K2 {
else if (document.layers){ j& T7 G0 p9 ?) \" ] k
ns_marquee=document.ns_marquee.document.ns_marquee2
- v& n/ ?1 d7 N" r6 `$ wns_marquee.left=marqueewidth+8
& _5 U2 R# {. k6 w3 s( ]ns_marquee.document.write(marqueecontent)
& X) l' I5 g ^' Ans_marquee.document.close()
1 x% u% ^% B: C( P2 f" r# l5 cactualwidth=ns_marquee.document.width% l# d$ O/ F- E* e* N
}: w; I% \+ B% s, d2 z
lefttime=setInterval("scrollmarquee()",20), F* q$ V0 _4 | w, W
}; Q( z/ F% R! ?+ q
window.onload=populate% s% w) |' ]: ?6 Z
8 |7 `& O6 T" \) q U1 W6 r
function scrollmarquee(){' B. ]) v G: z1 o" r# H
if (iedom){
C; b6 d' t; a @' y- kif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))4 \2 S& }, F, T
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
8 r) k8 m( c% H+ ]$ |% yelse2 g1 m% b- s4 K/ d6 y/ ~% b' E3 w; c
cross_marquee.style.left=marqueewidth+8
- b3 ?$ x. P* b9 _3 g
4 A. n1 O3 E5 P( P# l- h) h9 }}
: x8 a7 q1 i: b N8 ~& L1 Nelse if (document.layers){+ R( Y8 n: J% _; ?
if (ns_marquee.left>(actualwidth*(-1)+8))) ~. Y- a$ V$ @" v) l
ns_marquee.left-=copyspeed4 ?4 f$ P b1 U/ Z3 t5 [, j
else5 q* b3 X" f5 b# c$ G
ns_marquee.left=marqueewidth+8
8 \: x1 G, G8 K( ]& L* O}
" }/ B1 W: K- h. u- u6 S}
1 c6 S: I: t) {$ P/ O( _0 u. E; W+ H" d) B% F3 a
if (iedom||document.layers){
* H- j1 u/ [! }1 X9 a& uwith (document){
+ ]9 M/ Q$ M6 Q4 o0 F/ g* F' sdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
5 B/ N7 z4 h- C5 S, mif (iedom){! o3 }, d: m. I
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')1 k2 Q% x9 j$ v
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
/ }! t/ H) T% R& F+ H) Mwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
0 A% o& o4 {# o% F0 @0 K$ kwrite('</div>')/ Y8 F9 z6 A' T {7 L
}
* {* X3 L3 | Y( R, F0 F6 g1 ~4 Welse if (document.layers){' W2 T: V9 i+ i: O, h
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
/ z4 u, F/ p+ i0 ?write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
' k7 } @+ y5 g& D( g6 z5 v" twrite('</ilayer>')
3 @2 C7 Y: B1 _ q8 B* ^+ ?8 I}
2 c5 D" l, Z2 H+ o* d7 ]6 l* T" g% A0 Udocument.write('</td></table>')1 |. l9 Z0 {! Z' |" o
}
9 ? T0 _6 d T5 a9 R) F6 p, N! {4 v}& F! z- X3 `* [" I$ |+ i) G
</script> |
|