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

|
网页之跑马灯文字特效
//修改宽度* L. t$ ^/ |+ X+ Q* S" E& g U7 E
var marqueewidth=3000 x/ l d6 Q% r1 a
//高度
8 W/ B- q" S* d I. E, G: Bvar marqueeheight=25 O6 h( h4 H* O: Y( m2 \$ F. ]6 @
//速度(1-10)3 x8 |( k& K' ?" g9 o, l0 w
var marqueespeed=3# h3 s" L; W) O( R
//背景颜色% A, d4 H5 O# Q& C+ k9 Z
var marqueebgcolor="#FFFFFF"5 X- D- a0 K4 g2 [/ ^
//是否能暂停 (0=no. 1=yes)?
4 D* e; P' @" K( Y: }& P! d. ~var pauseit=12 d8 m! S5 N( x6 a/ Y5 e
+ j. v6 \, y$ b; y: k7 h
//修改显示内容
; M: @9 I P4 |$ E$ v4 w1 X. Yvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>' u: p7 M; g W
9 ], |9 K/ f9 u
: c; C8 c9 O! D$ L( N, i8 D////下面不需改变////////////
7 E+ y2 z! m6 O( \8 _+ y2 s7 G- d# s" X$ \8 {
var copyspeed=marqueespeed% k7 o! e# `* O! E5 ^
var pausespeed=(pauseit==0)? copyspeed: 0
% U* D* J0 M, x/ I4 j3 G9 N! ^) j bvar iedom=document.all||document.getElementById
, S0 g: U2 g5 u& Y& ]if (iedom)
' U5 q, L3 M- Wdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')( o3 b2 I( }% e3 [
var actualwidth=''
' a( {" i7 y; \# ^. Mvar cross_marquee, ns_marquee
# t( p& b" T: X8 P0 |
d' T% e! Y$ \9 m) [0 C0 q3 S+ qfunction populate(){% G; L( h- \) o$ }! M, }. K! s; U+ x
if (iedom){
+ f/ ? e# n$ Y$ l* Wcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee. ^. f4 y/ s& V0 ?
cross_marquee.style.left=marqueewidth+82 }9 o2 x. [) M! _) K1 h- o, ?
cross_marquee.innerHTML=marqueecontent
- ]) L6 Z1 j3 t9 z- S5 z/ _) tactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
, u/ g( A) [2 e2 k( ?}3 N' z' K r% S$ r
else if (document.layers){- ~) h! x G# h; _. Z E$ o* [: U$ j
ns_marquee=document.ns_marquee.document.ns_marquee23 K. M3 F% K) l2 }' X/ i
ns_marquee.left=marqueewidth+8
4 R$ [& x2 h6 m# cns_marquee.document.write(marqueecontent)) q/ b' X$ k) Y$ Z
ns_marquee.document.close()
3 J/ \ i+ z- J4 E) vactualwidth=ns_marquee.document.width+ r0 T- }; h4 `# E
}
9 F2 B% u ] A. U: _. ]# Nlefttime=setInterval("scrollmarquee()",20)
& x' g, O$ J' d9 w) E}* o, `( p6 ]! F* o: s" K* O
window.onload=populate
. ]; [. E. Z7 r% @; @6 n( x; {/ Z, `+ h- L0 }" }( B' o9 i3 A! a
function scrollmarquee(){
y# z( o# S. q2 n% V$ u& [if (iedom){
; R+ S/ ?1 @+ L; R6 [4 }9 Bif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))3 r' V8 K4 y) I; ~
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
D! @. m! v. I8 S" G4 Nelse0 P0 @0 O5 g1 |: ]. W! i0 S
cross_marquee.style.left=marqueewidth+83 v" W6 L: g4 i; Z7 a
: u( x- ?3 r6 ^}# q- K/ ]: _; C$ k
else if (document.layers){$ k4 C& p+ x; c9 m8 ?0 T9 f5 \
if (ns_marquee.left>(actualwidth*(-1)+8))
* ]; p/ j! ?6 C( _ns_marquee.left-=copyspeed
8 d+ x, `! I3 _( kelse: C3 [! ?+ ~: M& z# O* B
ns_marquee.left=marqueewidth+8! M. ~% ?, p. D6 l
}
) ~3 S4 Y# y; c: s+ E}
7 y, h8 n- S* Y! W
& x1 R# }9 {4 q4 x7 [ ^if (iedom||document.layers){& A, F6 w! {0 U1 N: F+ ^
with (document){0 x+ L+ A8 d( p5 x9 J
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
|1 h2 w0 A4 H/ R$ hif (iedom){
7 _9 K0 z1 g3 N' D8 b7 Owrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')) n- r" x" R' W8 o% \8 H1 @( t
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
1 `( \2 E5 }5 {write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>') G" m: Q; X2 ?: b/ T+ j
write('</div>')
) e& b. L$ q; Z' ]}( o/ a, Q2 ^$ H, f, }; z
else if (document.layers){
. y4 H( i# c: t+ ?- lwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
# n: c* B* q, t* L( p+ `5 gwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
0 Q" c* Y! E8 f* ^, h5 H9 x5 m9 U; Iwrite('</ilayer>')8 \( Y: b* \$ J0 L
}/ `& J8 j3 h1 r/ b0 o9 c0 L! e
document.write('</td></table>')
% h& A, C e$ I2 |}7 O+ E1 W5 Z3 K" @9 i+ v
}9 ]& R; v0 [ f5 ^% E1 B) M
</script> |
|