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

|
网页之跑马灯文字特效
//修改宽度
/ O. _, U) b9 ?' m5 W2 L: E# jvar marqueewidth=300, ?- ~1 v5 s: t
//高度1 K1 k' d0 L$ f( ]8 I' n/ x2 O
var marqueeheight=25
. b; o. i8 k- R, }$ b//速度(1-10)
& t0 R% g8 P* ]var marqueespeed=3* ]1 @ d. D* n6 g9 |
//背景颜色
2 R( r& U: c9 a- Y# l, avar marqueebgcolor="#FFFFFF"
2 s2 | i$ R k' v; p8 p//是否能暂停 (0=no. 1=yes)?1 M: O- k* \/ m' [
var pauseit=1
x2 c6 |4 E% a* u0 E, Q8 \/ i: K# ]) U+ ^. Y8 m* ?3 u$ w2 F4 {
//修改显示内容
+ [) E9 s. P- {, r& M7 W7 h( P( Rvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'" Z5 h8 S ]$ v; _
# R* c& K6 [8 `, w
; n/ v. o' J% o4 ]5 x////下面不需改变////////////
; _( \" B2 L8 W. q6 d/ Y7 |1 ]4 F
9 U3 e6 k9 m3 R# L& m5 E( ?. _var copyspeed=marqueespeed. t+ H2 z- _0 o; S. f
var pausespeed=(pauseit==0)? copyspeed: 0* g' v5 Q4 p6 x& K" r$ n, e
var iedom=document.all||document.getElementById6 x4 D S! N$ P7 F/ c- j3 ~
if (iedom)
$ l4 P. d# p. A3 E9 P5 y& rdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')2 T* |; V4 r7 Z# u5 c; _1 a+ [( K
var actualwidth='') j; T" L1 M% t- {, Z* ^2 Q
var cross_marquee, ns_marquee+ y- o4 I' q L# F3 R9 o( Q: h
& }3 M2 H7 O; y0 k9 o( |
function populate(){& E" [/ h7 B8 {7 C7 B% b8 G
if (iedom){( j. C) E/ y- f0 h. G% ^
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee9 N: R( [4 }0 t
cross_marquee.style.left=marqueewidth+8- Z& J! E( n* }9 z1 Y
cross_marquee.innerHTML=marqueecontent
8 P1 @2 v6 e7 N4 K# c# vactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth/ W, T4 L: E6 [3 O, W
}1 N+ v# y7 p0 P2 Y9 i+ z
else if (document.layers){
/ C' ]' l- G9 w9 }" Q& V' bns_marquee=document.ns_marquee.document.ns_marquee22 x5 g, a4 ]) P& r/ y1 b3 l ?
ns_marquee.left=marqueewidth+8
( F" C7 F3 ]/ L/ ?! Ens_marquee.document.write(marqueecontent)! x1 T' k& a( c+ W+ F. B3 ~
ns_marquee.document.close()0 s0 q8 W% o- M; t# ?; Y
actualwidth=ns_marquee.document.width) N7 G/ }6 j# b7 ?) v3 V7 S
}
0 s" D0 D& n" ulefttime=setInterval("scrollmarquee()",20)8 Y! Q4 f5 z7 S% J! K. I
}! v, v# s D2 b. U3 l; m
window.onload=populate
' J0 r! @7 }0 J& B2 s
, z( ]/ o$ ]. Efunction scrollmarquee(){# d3 h, I2 n9 D. y* E$ Q& c
if (iedom){
( y8 R- {, [# o# @2 x& f8 O% y/ gif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)); Z* c/ H1 m3 D
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+ |% R; j2 h* L, E( c2 {
else( r U r9 x5 W8 J# {
cross_marquee.style.left=marqueewidth+8! j! p8 x3 r+ F
& B* h% Z p4 o0 ?+ e F. I5 [
}' d% F; i/ h2 S. @
else if (document.layers){. T4 W: E3 ]# l7 p4 V1 F( L
if (ns_marquee.left>(actualwidth*(-1)+8))
7 t' L/ L4 O Y7 S# ~4 y6 K: Lns_marquee.left-=copyspeed( f, J$ Y; S2 H$ C" y1 `
else) ?1 U2 @6 J5 b8 d
ns_marquee.left=marqueewidth+8
3 N$ |8 a3 D% F4 o! b. n) H0 @9 P}" D# G: O( D& u' |' R
}
7 n7 p9 g# [' k( T! O8 I+ {! w8 ?4 J7 e- |
if (iedom||document.layers){
J( H% |2 S" Z/ ^/ [" }% Owith (document){
% X7 H" B2 f/ e3 G1 hdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
N' X3 |# Q% j! Gif (iedom){
4 X/ L+ A1 U2 n, M. z0 ]write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')+ }, H4 u6 A8 b1 F* Y8 D
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">') F$ r0 z% D* j& b% l7 Y( h
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')6 Y8 \+ c- ^0 J9 ^$ g' O6 v
write('</div>')
|6 I0 Y. d. l% P6 O5 n+ _}
. |4 S+ O0 F( p q, [9 Qelse if (document.layers){: ]. F; t) i3 D! X1 Q
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
" u i$ d7 e' w1 awrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'); s% |% |6 B& N6 w# r
write('</ilayer>')
8 _$ ?% R+ J$ ?2 g1 a3 O}; O" I& J- r; ]9 K1 q \( F/ X% D
document.write('</td></table>')* U$ I. N$ b- r e: i4 A" W u4 u
}. |( v. M9 ?2 _; R5 ~
}: T, h8 h; W1 ^
</script> |
|