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

|
网页之跑马灯文字特效
//修改宽度( c( r9 q* g. j
var marqueewidth=3007 W$ t$ p9 o" }9 K: j4 b7 n7 o
//高度6 J! c( {( \+ S% Q4 u- n9 n1 t
var marqueeheight=25
" M' {: C% X+ L4 E//速度(1-10)
# z. o/ F* W& M: K" t9 V4 Rvar marqueespeed=3. S5 Y$ p1 q. p" h. s# v( |( p6 P
//背景颜色
0 \8 m4 M1 w5 |8 s9 x0 T& W8 Fvar marqueebgcolor="#FFFFFF"
7 f+ X5 \2 D0 A8 V" [$ {- u//是否能暂停 (0=no. 1=yes)?
$ q0 Z9 B Q7 T$ Z- i+ a7 T' c3 Cvar pauseit=1$ ]6 b2 `4 C3 }/ @8 f1 R, w/ f
0 B' Q7 i$ b' z6 I//修改显示内容* c3 A6 Y! N5 i3 X( z4 f! }& E2 Z
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'- {1 o+ X" W% T1 F" K* V4 a" S3 v
/ L1 q9 X- `; _/ C
% C! [$ ?2 T/ Q4 v8 z. Y////下面不需改变////////////
+ F' o" C0 ]% x
! [# c* E( [3 {5 i4 O; ]var copyspeed=marqueespeed6 g. b% t! ~, x
var pausespeed=(pauseit==0)? copyspeed: 0
9 v$ E, m; L( r7 |! B7 v% [var iedom=document.all||document.getElementById
4 j: k- ~$ n+ T+ |6 F% G# n1 rif (iedom)
! Y0 a' Z# H& Xdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')& Z& { T- o# x2 ]. n( y' E
var actualwidth=''
, c; \$ q$ x) c @var cross_marquee, ns_marquee
( H7 E' g: J' U8 f% Y8 B u8 ^; Q) L; |# G9 B9 Z( {
function populate(){: {; O( l0 C* a; G6 E
if (iedom){1 _1 D' Y d( v1 h/ h
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee3 `9 ?) Y3 [0 y( R0 u2 z; h, b
cross_marquee.style.left=marqueewidth+8
( S6 G' F# J, g8 rcross_marquee.innerHTML=marqueecontent
' }6 o! l l) F& @* hactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
0 n" R$ H6 z% k6 { d( V* H}
) G& c. m# X; E7 ?else if (document.layers){
, `' b u1 J- q5 P1 ?) W9 L$ mns_marquee=document.ns_marquee.document.ns_marquee2/ E7 u& a2 r( }. J
ns_marquee.left=marqueewidth+8' x2 L+ X; q8 O: G- a) O3 O; U
ns_marquee.document.write(marqueecontent)
( {; p& V" S. L' i3 _$ N6 Z5 o8 Cns_marquee.document.close()' `) _7 v: x. y+ t) B4 [" Y) r) }
actualwidth=ns_marquee.document.width9 p3 q* F) j' n
}! ]% t: c; {9 ~5 o5 @6 P
lefttime=setInterval("scrollmarquee()",20)
9 {1 z2 O# ]- g7 Q}6 ]& @% n9 V) A' I) A8 \# s j
window.onload=populate
4 O, \, B3 \# y f/ j( J
) Q# @% b9 V% |- R9 Wfunction scrollmarquee(){: ^, w. N9 V3 n$ a7 I8 F
if (iedom){
1 b( z0 C% A& X. P/ `" ?; ~if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))1 T* ]9 @: V" S l* T3 ~
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
0 M, W8 u/ |, d( F3 Ielse- ]9 C6 f( {; D) Q# F! P
cross_marquee.style.left=marqueewidth+8
6 F, u8 V7 q6 V3 h" a M9 G7 u/ \0 W+ X1 u
}$ V. m+ m; f" [! ?5 C# ~
else if (document.layers){
$ F q Z# W+ F* j3 Cif (ns_marquee.left>(actualwidth*(-1)+8))
/ u/ j) N/ w- Z, V( vns_marquee.left-=copyspeed
9 a; v0 K! [% {5 w* qelse
3 v9 ^0 v# s* Y* h1 E: lns_marquee.left=marqueewidth+8
8 K% g) |6 D0 b% G$ t, f0 M}2 J5 i0 ^# D7 P8 H9 M
}
, w5 S* ~3 ~; [: W
$ U) S9 N3 B0 h j: ?9 D* O& Vif (iedom||document.layers){
- d5 O+ A5 T' [+ T/ \with (document){
. W6 r5 {' ~0 d& }! q0 Q' ?/ ]9 `document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')8 r3 W. e5 x1 h7 d1 a
if (iedom){
. B! @6 K6 e4 g% _- D3 jwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
' D! x+ ^. h) @# ^5 s1 I' c- F; bwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')' E& z1 T0 I' T& a4 T! q
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')0 B. ], T. P/ L
write('</div>')
! \5 x! l! W( B# @$ A6 |% a}. ], z- _# N0 Y
else if (document.layers){
) Y! a$ ?* g n+ hwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
U; _: W$ W9 z+ {& Ewrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')+ i5 Y- u3 V- k. P& J- Z) b
write('</ilayer>')
: c, g5 {5 W% b9 s/ P0 d}. b$ {2 V0 d6 j2 s8 a
document.write('</td></table>')5 K9 S( P- ]! L
}) o- h' h# G o1 q9 k1 r3 f
}- P4 V+ @3 U+ s$ D* U
</script> |
|