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

|
网页之跑马灯文字特效
//修改宽度6 I k/ a* w* F
var marqueewidth=300
6 v9 H) B% l$ @. T) s! F6 v//高度
, l$ s% o/ y. ~+ v& _ ~. cvar marqueeheight=25
! f4 [7 }6 Y, E% h3 ?3 n4 c//速度(1-10)5 s' y D* g- H
var marqueespeed=3
6 I9 Y, O' X5 l: |# i! ]6 O//背景颜色
) S( u3 n1 @2 X9 d1 Z( `& C. g" ]var marqueebgcolor="#FFFFFF"9 M4 O3 E0 S0 ^/ v
//是否能暂停 (0=no. 1=yes)?( `, q- h/ o# ~7 ~0 b
var pauseit=1
0 V( L# _3 a* i; {
) P. D+ L* M- n+ a//修改显示内容
% L q2 m4 z7 F. |- H$ L1 jvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'. [1 } j0 S1 H9 i8 g4 m3 G
5 _5 ]& V( f+ T$ k" i M* ?% F
; e0 u8 E) A3 I, _////下面不需改变////////////
* `# z' i2 _; C: I0 v/ f* f; a
7 X0 B3 i& G+ O% f" R ]0 dvar copyspeed=marqueespeed
' L% p% |( y: _5 I- d( fvar pausespeed=(pauseit==0)? copyspeed: 08 m% j$ `# D2 _
var iedom=document.all||document.getElementById' D# i" G) O9 d, i% n
if (iedom)( K3 W Y& W0 e; f$ E3 i( q* z) z
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')* f/ p7 |+ ]: b- ^7 C: j
var actualwidth='': }* C ^3 Y' n
var cross_marquee, ns_marquee
) X: @( b% B. d" M6 ]% k/ a) V- ?8 f; ~! i
function populate(){2 v9 p+ Z* r' m" U" ]
if (iedom){6 b# {0 q% B' n
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee/ I8 r; A8 ?/ Z5 X
cross_marquee.style.left=marqueewidth+8
. ^+ W1 \, o, [, m! c" O( Ocross_marquee.innerHTML=marqueecontent
& \4 W/ k) P- X9 h! _# Y9 lactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth! y' f6 U: _0 ~! H
}1 J7 V% b" O H6 d% K
else if (document.layers){9 i* ?/ {3 X- ?1 I7 m
ns_marquee=document.ns_marquee.document.ns_marquee28 L$ n8 l0 N8 U8 E A1 E. R
ns_marquee.left=marqueewidth+8+ D' q2 H% t% a, [# ~
ns_marquee.document.write(marqueecontent)9 e9 W2 ?! z) q- D+ X+ ]9 W
ns_marquee.document.close()3 P) ~4 M' M$ R
actualwidth=ns_marquee.document.width1 u. r) e% R: Q1 s, a3 K J
}
2 K e# x$ O3 e8 Blefttime=setInterval("scrollmarquee()",20)7 V( s5 t T+ R# R
}* ]% s/ c+ I A" \1 B
window.onload=populate, q# U4 w, j r" k, C/ G5 W
L/ ?7 Z% P; n+ e/ @) [7 I C, rfunction scrollmarquee(){6 u& ~8 G" t- z/ l6 u: k) N
if (iedom){
# ?" e8 S" D: V' f) \% Mif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
- C7 B/ w9 B0 D, }cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed7 k" I- a4 D+ J3 L3 [& P* {
else
0 c' Q3 i7 v( Y7 g; }6 Tcross_marquee.style.left=marqueewidth+8
* Z" p2 D# @5 ?" j
" _' Q, E" U) f3 y+ v- v}) C. W W$ r2 ?
else if (document.layers){; P/ m \& d) I9 ~" `* E) b" h! R+ a
if (ns_marquee.left>(actualwidth*(-1)+8))
" e) b# O1 [- D E! L( Qns_marquee.left-=copyspeed ?8 c. o( Z% y* B& i9 Q- r
else1 v! K8 {& K# R, z
ns_marquee.left=marqueewidth+8/ U' f: j2 j/ e3 Z( C. r9 O
}
( {+ I# P, U# T0 a5 O}
' Z; k# J; k1 z
% |, o+ d+ s$ ~. v2 g' Tif (iedom||document.layers){
) ~: C% Q5 N' p9 }: Z! M- }' Swith (document){6 |; q7 }0 ]& K5 U: V
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')' q. b, n/ r, D$ V
if (iedom){
8 |$ {3 Y- d }9 Dwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
+ U: _1 j0 l5 f7 ], }( _write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')6 S) Q7 \5 N3 i0 N6 a( L. g
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
4 e6 ? D: o; R; Q- y+ I: `0 e, Fwrite('</div>')# X, _0 ]! d5 d) T3 z) [6 u/ U
}
+ ~7 E- l5 I# L3 c# C7 oelse if (document.layers){% A( i. h& q6 G
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')% d' j' x: _6 E
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'). t2 q' l6 b7 ~$ ?. z6 [ D! }
write('</ilayer>')0 K* J6 A4 a! \
}$ m# F' v& i, c- Z
document.write('</td></table>')
O, u E4 n, {. Q; z}" W& [2 g) {+ U/ f9 G
}2 O, Q' ^0 `. {1 w- H
</script> |
|