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

|
网页之跑马灯文字特效
//修改宽度6 D$ s2 o6 H& [5 I& P9 B1 p5 B$ D
var marqueewidth=3003 U% {' s& k$ H3 \' T& {8 j
//高度
6 }2 l5 C6 r, s" ^% S- F+ fvar marqueeheight=25& j% t* t s3 J) j# v
//速度(1-10)
. _) K% m# M8 `' U" Qvar marqueespeed=3* w' Z: x5 _% a, H5 \1 }2 W% [
//背景颜色9 _+ y8 O1 ~ \. u& i( T& L
var marqueebgcolor="#FFFFFF"9 ^# f& K/ C9 p* ~3 i
//是否能暂停 (0=no. 1=yes)?6 o5 J: V+ S* }, g; s' o
var pauseit=1
* e2 F( q- \& r: o0 {: w/ U& x( b0 m" v
//修改显示内容% ^! n3 R% G$ j9 d0 R
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'; h; |1 x7 k6 U. G* }$ t
7 S, w; x1 d4 b H2 @5 h: Q
0 ]: U4 c# _! W. K @////下面不需改变////////////
6 p0 N* j& ?. V
( J2 ]- s8 c$ H+ Yvar copyspeed=marqueespeed" \, K' L0 g: D7 C3 M: k4 b, w, }
var pausespeed=(pauseit==0)? copyspeed: 01 c h" Q4 v/ H) C. q5 C
var iedom=document.all||document.getElementById8 q' E: }6 A1 [. z
if (iedom)
8 |6 Z. ?) G# N# ?document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
/ Z2 u0 n* _8 X$ E3 o) jvar actualwidth=''
0 P5 ~& y+ F/ g9 g. ^7 ?var cross_marquee, ns_marquee# o$ M$ y3 @$ g; U5 [) T' z. t$ z4 S
! g# e/ p+ B0 p+ g0 E$ Y0 g* [4 ~
function populate(){
" {* A' l, h. O* z S Hif (iedom){
% c% V, H. N8 M' d, ]cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee& r/ d/ M, g8 J d m% i, f
cross_marquee.style.left=marqueewidth+8
0 h: m# W1 ^. rcross_marquee.innerHTML=marqueecontent" q; L- S. O" ^5 `
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth* ~. ~, e. H4 r
}
' i; A& v/ ]+ H4 j' Jelse if (document.layers){0 o! M9 ?0 ~- i( W6 d
ns_marquee=document.ns_marquee.document.ns_marquee2. X$ G+ T: O- b0 g, r9 K, m
ns_marquee.left=marqueewidth+8
$ P4 d7 z+ {0 ?) [5 g$ B, Q/ F+ pns_marquee.document.write(marqueecontent)2 N+ ^9 `9 I' \1 s7 n- {+ a
ns_marquee.document.close()
4 q( C: W* S- j4 g( j! _9 ?& Nactualwidth=ns_marquee.document.width+ ^- g) _' _( q& ]2 D8 v
}2 ~2 ~- X( m6 q4 Y
lefttime=setInterval("scrollmarquee()",20)
M. u. `0 [, A" A c3 M8 E- X}# J7 O* {! s! f/ E0 Z
window.onload=populate
6 L( e# l0 G0 \4 a( E4 _9 Y7 [, ~: x* P/ i. O- j( O6 d
function scrollmarquee(){$ v9 q0 [+ k/ n
if (iedom){# h1 [1 `9 I/ D/ T
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
( w$ o4 m1 u M; y! {3 mcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
* U P |2 ~4 F y# Q4 [* oelse
3 E- w, `0 a! c! v# r: B5 `cross_marquee.style.left=marqueewidth+8
. A% y# H8 m# m$ R9 d+ b9 `7 ^% ?0 @
~# o# x( C. E3 E0 ]+ P" H, b# }}1 j, r) v7 V$ Z) }0 T- X+ I$ B
else if (document.layers){! w# _! t7 t# U1 ?; T
if (ns_marquee.left>(actualwidth*(-1)+8))
) R; A: t' j4 ans_marquee.left-=copyspeed' s# W" K" l% H2 H
else0 V2 k; N) ~# y0 {/ E4 R
ns_marquee.left=marqueewidth+8
0 b" s6 E" V4 e9 ]}
; i. z$ A, o# R}
3 D+ M: C/ ^2 I H: Q
% x7 O. n+ u/ F' cif (iedom||document.layers){
* _& W! I: ~" V: X+ W; bwith (document){9 ^1 }0 _0 o9 a0 H! J3 H, G& Q
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
+ Q3 C- J* x1 _# B7 ]7 @2 f( q+ yif (iedom){
$ n5 z; A; Q8 f4 V k7 Q/ V% Owrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
" r& h- C' y, \6 n% h* z$ wwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')- U, j: A* m; W, h P2 P. e7 t
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')$ `; e0 ]3 I( E U
write('</div>')
1 T; `' s" u. z3 J9 w' @6 C}
v7 S4 T" y0 T1 [5 x1 q j! P# gelse if (document.layers){
: S( p! [4 K# M, ^+ Kwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
" X( \9 j# k9 ~# h' nwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'); x- U9 m9 V% c5 k) n
write('</ilayer>')4 z4 _5 j# S, E+ I& `- o
}
% H; i5 ]3 K; C! Ndocument.write('</td></table>')
7 |& F" `0 e3 `3 S0 q+ G7 \: ? b}0 N1 d" ^) i* t
}( O/ o& W; w1 K
</script> |
|