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

|
网页之跑马灯文字特效
//修改宽度5 w" T; i+ e# K/ i e( B
var marqueewidth=300
5 F' t9 l H _* j% H' \2 T//高度, _/ A0 I) d9 r% q$ A* D
var marqueeheight=25% G7 H, ]: i+ W6 b8 C
//速度(1-10)+ m3 W7 ~0 f: k" N. A3 J
var marqueespeed=3
! e* J- w4 u2 N2 J1 B( {//背景颜色
. G3 w$ c& Z1 T: }3 x; _" Vvar marqueebgcolor="#FFFFFF"0 ~- D. u8 F+ T1 [
//是否能暂停 (0=no. 1=yes)?1 _3 t( c, v- s$ c( K/ {) o" M
var pauseit=10 R9 C% Y- n: V" J8 G( Z
5 N1 {( A( N2 V! e9 l5 V, H+ A
//修改显示内容
) |! Z4 b* l: Vvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>') E( @! D; R/ \4 g8 Q8 U0 I9 D
- e, L! z8 X( H% m7 O4 r$ x
9 o: W1 k" U% f6 {+ ?////下面不需改变////////////( |2 }! u+ N9 J+ p2 z% _4 L
0 D# b9 r$ s8 b1 {4 V9 n
var copyspeed=marqueespeed
6 |& l) s4 Q+ }7 `2 F. `# jvar pausespeed=(pauseit==0)? copyspeed: 0- A# e1 P! ^2 V. y$ r8 ]
var iedom=document.all||document.getElementById
9 i* S8 ]0 r4 x4 W! K* Lif (iedom)" W" t" W/ ?! G0 d8 Q* Q& a
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
% _$ ~; \1 w4 Hvar actualwidth=''
0 j; x0 g5 N0 I$ F* \& ovar cross_marquee, ns_marquee
- [5 s; [3 N! A! e/ Z) h2 j# t
3 j& h7 i; l4 P# ~* l* Pfunction populate(){- u' M# g! z- p+ d* X
if (iedom){) A$ E: ?2 S/ I9 }
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee7 A! @6 A" |( k( F! y: c
cross_marquee.style.left=marqueewidth+8
' x( a, u0 r: d3 w/ c. I3 Fcross_marquee.innerHTML=marqueecontent
" W) M# [! J) C6 A4 T2 Yactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
2 W8 f5 i+ ?/ A. O}& E' u5 Z a% X8 U& _
else if (document.layers){
2 {' t1 ^: r' @+ _! h6 I3 q7 Nns_marquee=document.ns_marquee.document.ns_marquee2- X. L2 i# r' u, @( T4 U' Q" {
ns_marquee.left=marqueewidth+8
4 } \) w0 [, p6 B/ pns_marquee.document.write(marqueecontent)
- z0 P9 p w1 W! D& |ns_marquee.document.close()( ?$ e! C( L% f. y1 X8 S4 m) M, c
actualwidth=ns_marquee.document.width, D. o! M" I& p9 V5 E
}; [% a9 _( ^. E; f+ X6 U U+ o% S
lefttime=setInterval("scrollmarquee()",20)
$ ]; t1 x+ X; v}- U. x; L, k, L( U
window.onload=populate. m4 h( N, m( d$ Z) q6 x
# x% i* G& \6 @: i6 c$ x: t9 zfunction scrollmarquee(){
+ G/ R9 S7 U. f |6 B8 gif (iedom){9 h2 s1 g5 e$ `+ H
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
: ~3 `: C4 b: S, y3 c _5 |% Ucross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed8 s" D( }4 T1 F/ L9 N
else
! H1 u0 Z% N0 }1 w, z+ Qcross_marquee.style.left=marqueewidth+8; q/ n# R0 M( v$ I' _$ U' O$ K0 v
) h9 W( \% Y' ?' n% w}
2 T& C; k0 Y& v$ Velse if (document.layers){! {( [9 n( {: e+ @: \8 ]9 l
if (ns_marquee.left>(actualwidth*(-1)+8))& \# B/ B+ `! J' _( B( V2 J
ns_marquee.left-=copyspeed
2 _/ i% K6 \$ V: oelse
0 f" `/ a/ c# r" ] M. zns_marquee.left=marqueewidth+8
9 p- I. N% d5 U}
$ S5 j0 |5 c9 j8 y8 E}
5 i0 ^ s- C6 j* u. v
- s* A* C: f" V% |2 J3 }if (iedom||document.layers){
; ?3 u7 W9 J9 rwith (document){8 _% B/ J6 w0 \# v7 p* e6 J3 A0 S5 x
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
/ k9 J* H. q$ P. ^0 v6 Fif (iedom){* N. R; s: w$ b9 J& m4 m6 p
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
! }0 {) d) ]$ D! o& Fwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'); ^* l. Q$ ]! W4 x" b$ u
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
3 z. L l1 d. {/ xwrite('</div>')' J8 c5 l' j2 g6 I8 f* T9 c& i" w
}4 |( X- M( r+ w6 z5 f) t- `- B0 X
else if (document.layers){
6 }. Q. S q8 a. s! `1 jwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
( G' q# \1 u3 g( Bwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
2 T _6 |: ?" c; F# `write('</ilayer>')3 \5 C! F" P! x# R% @
}4 ?' ]/ a& X7 @+ g/ I h- o p) x; L
document.write('</td></table>')
, l2 |% C- k& W}) C/ G8 U# f+ w9 x' w' W; d- G
}5 Y5 C( L# Y7 s. e0 j# a
</script> |
|