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

|
网页之跑马灯文字特效
//修改宽度0 t; \. W' R' y
var marqueewidth=3006 p* A" l% U% L. u2 }
//高度4 Q# s! O" D" H1 A3 T! I
var marqueeheight=25
1 S: j* M F! n% j. p//速度(1-10)
- v( a% d! ^( }: m. T4 Q9 e2 M" a& Ivar marqueespeed=3
4 |! K% D; \) c6 K) _' E//背景颜色; W8 k E3 F* G0 T0 Q
var marqueebgcolor="#FFFFFF". K9 r! {; N% x$ i& R& C
//是否能暂停 (0=no. 1=yes)?8 |; l, ~( _( s, d+ F
var pauseit=1
# p7 k& R0 O2 q% J: o/ X$ I+ Z* I( q: H+ O0 p, z# K
//修改显示内容9 z9 F: C* D$ i6 X
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
! @8 c1 Y' T9 R# y' W( q( Q8 c3 ?" ^- L1 j" F" j
" a) r* w: T+ a1 [5 K- Q- B: `) K6 f0 B////下面不需改变////////////
# @! w0 X5 g* G4 D1 D% _# j9 f# p$ B: j& C* `
var copyspeed=marqueespeed3 m4 M0 e, Y6 E2 P' b) t, F3 L9 a
var pausespeed=(pauseit==0)? copyspeed: 03 Z+ w9 w2 X9 J
var iedom=document.all||document.getElementById: Q( H+ F z9 x* t) H [
if (iedom). {& ~ U* L( E9 u! b
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')4 L- H' ?: ~! w! P" N
var actualwidth=''
# Y- T: B z, C P6 `" `& ovar cross_marquee, ns_marquee3 E7 } B( w' O6 l2 u: A
" j9 n! } b2 R0 @3 z; nfunction populate(){0 a9 c" z* @% w+ R/ @8 ?1 o
if (iedom){
, ?5 _! h8 ` _; k8 m Lcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee% u8 b, ]7 E8 j2 q( {0 U8 T8 F
cross_marquee.style.left=marqueewidth+8# I- f& D$ U) n4 o
cross_marquee.innerHTML=marqueecontent
/ g8 k" X! O. M8 l" c: Zactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth* Q" L: [/ y" x+ b! F
}
% x3 n+ i2 \6 }7 O( Oelse if (document.layers){1 }5 k$ `' U: l4 b1 ]: t
ns_marquee=document.ns_marquee.document.ns_marquee23 Y: P2 U0 m5 [7 L/ B
ns_marquee.left=marqueewidth+8
+ T' l8 A# z7 M& q4 T$ Hns_marquee.document.write(marqueecontent)
& ?0 a0 Z' v3 P6 Wns_marquee.document.close()
2 y4 F- Y; K& B6 z# p" \actualwidth=ns_marquee.document.width$ w( q* B* |: Y. B, t8 Y/ j+ ]# j( C( q
} `( ^6 M& \, ~/ V4 ^' n2 P
lefttime=setInterval("scrollmarquee()",20)
2 o9 {) W- e) ], @9 @( E; p}
3 B; N$ \. \/ d- D" R4 o% jwindow.onload=populate
+ h7 J' B( m) S* K3 M
% a l8 L$ P0 m2 }function scrollmarquee(){- i: G& W" i7 a) N7 J8 f: R" b
if (iedom){; X& @) J1 b: e# ^
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))$ X1 k; v9 S% E5 x; M: O* Z" g
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed6 r, _1 u3 X5 B4 k
else
8 n9 ?+ L7 c. v, l8 l8 Q+ fcross_marquee.style.left=marqueewidth+89 h& ? O) G8 g" R
! A( I' V1 k; ?}# j4 z/ F, F8 H! a8 `5 h6 C8 `
else if (document.layers){
5 t( v q, w( A8 c* M% ^if (ns_marquee.left>(actualwidth*(-1)+8))
* ~+ E3 z: S5 [9 a& [ns_marquee.left-=copyspeed( ~6 q5 \) C6 A B
else
) j+ R; E% h8 k% q# Ens_marquee.left=marqueewidth+8
( O: @$ j. l9 K7 ~) i5 O}
& |0 a) J' M( e% I}. K& `) T2 z5 l5 y, v
% d5 P1 Z) ~3 Q& l' dif (iedom||document.layers){- c; Z7 H8 m! f( R9 t9 R$ p. K( y4 n
with (document){# D% I4 O+ J+ l% M9 O4 G* r
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>'): q U/ X0 x0 q+ n0 P; t
if (iedom){
& x: ], e& Z" i6 |0 {7 vwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')1 s) H- U4 T8 F' f- a
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
0 l* t- {9 ?5 m' r7 x2 Bwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 H$ g, P# R! e" S; }write('</div>')
/ v" g1 u7 E( H% u) }}
6 M8 C+ D2 V$ g2 g5 F7 `" yelse if (document.layers){
" ?1 u# U+ Y, m/ Z8 e& v1 _3 Iwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')4 F4 `0 x+ o! l; z6 h: G4 E. n
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')8 @6 b* B' I, ~* x- ?. T {
write('</ilayer>')
$ X; m6 G- u& t# u+ B/ e4 V}: Y) n7 a6 n1 l& |0 y7 D0 q0 {
document.write('</td></table>')
" S Z" U5 t/ ]" y2 |% w1 n: \}
& Y0 O7 X! C! G5 G6 p( z! E8 F}
5 _7 r$ H; E) t& M( V</script> |
|