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

|
网页之跑马灯文字特效
//修改宽度7 o$ ]# S" K/ L/ e- c" s- L
var marqueewidth=3002 Z) M; @( F& p) l
//高度' u( L! l2 \9 w$ L- _' z; c9 q
var marqueeheight=258 E3 O: a: \8 k, i
//速度(1-10)
; a$ M1 {( ~: b( W2 @var marqueespeed=3
+ O& Y/ \( l( L1 G& A+ j6 A//背景颜色7 B9 ` s2 J. o u7 c e
var marqueebgcolor="#FFFFFF"8 W2 O& I. j% B
//是否能暂停 (0=no. 1=yes)?* W S% J+ W7 [" E `* s
var pauseit=1; l/ l4 K- K" X
+ n$ A; Q& ~/ P& h+ u- n# \2 w) ?
//修改显示内容
. Z" ^- c# R. Y% n8 m& ~var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
+ {6 G: @2 M! j1 |
) O6 Z: N! V% s: p" j+ h8 b' M
2 ^" C+ W# J2 W3 `, C2 U////下面不需改变////////////
6 h d2 l' {9 X$ ?( N7 f# C a
4 u$ c% H- k. c( v Yvar copyspeed=marqueespeed
! |+ s- z+ N/ r: d; s3 Lvar pausespeed=(pauseit==0)? copyspeed: 0
9 B0 V8 M J7 e% wvar iedom=document.all||document.getElementById
* |" ^2 s: S1 s6 eif (iedom)
, U8 ?) p% R8 s2 X5 kdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')% \4 x; q) J {1 V! ^1 A Z" h
var actualwidth=''
, [$ W6 h. e* f, O! s) i. n) u7 vvar cross_marquee, ns_marquee
, f* \! W$ }# }# |$ m0 h @3 ^0 q+ h3 a3 \ ?7 L
function populate(){
" n) S- @0 C8 c8 m9 u3 Yif (iedom){, X) n6 s2 K, g
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
2 x3 O( Y- k1 V, K% pcross_marquee.style.left=marqueewidth+8
( P( O3 n1 Y1 Y9 Kcross_marquee.innerHTML=marqueecontent7 b# o: ]+ E# ]; X; f" M G
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
( I' A& W0 Q0 G8 {6 D}. y! g& A& L2 d" H9 q9 o* b
else if (document.layers){8 L0 j" w0 f1 W2 j. i1 S
ns_marquee=document.ns_marquee.document.ns_marquee2
2 }5 m( Y1 ]0 h, e+ c" p) dns_marquee.left=marqueewidth+83 t; v& }3 i. L1 ~# z- B
ns_marquee.document.write(marqueecontent)
( ]7 r, W% u' |, c0 Gns_marquee.document.close()
6 Z1 x& i# r6 i) T4 factualwidth=ns_marquee.document.width
; A( @: M. H" W% u}
+ U9 Z5 |) l# vlefttime=setInterval("scrollmarquee()",20)# g+ g8 H" K; o- Q: ~
}
' L4 \3 i: X- x' s: ^! g$ A# ?0 `/ Fwindow.onload=populate7 K G8 T/ l8 [' `8 J
$ t5 p% ]/ g6 q. Z( Xfunction scrollmarquee(){! r* @( b/ A" t2 q- t$ U+ G: Q$ d/ n
if (iedom){
. J1 N0 l! Z* }if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
2 G2 l) i& z j: H! Y9 ucross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed1 q" ~3 `! K4 u. _( r" R" @# R
else% }; v3 m& K( R% t9 s5 o
cross_marquee.style.left=marqueewidth+8
$ g/ f, Z7 c' L/ F9 j+ h* g* Q' G* g
}8 g5 w" h) {6 `! `2 ]0 {
else if (document.layers){
! C% j* |9 m' e" Mif (ns_marquee.left>(actualwidth*(-1)+8))
4 u( {' y E* J5 xns_marquee.left-=copyspeed
N: P& g" @8 R7 Q* Relse
+ o l1 D2 l* q) lns_marquee.left=marqueewidth+8# ] \* v3 [) e3 \6 r% m
}, E% }+ }9 P+ R4 o% i6 u
}* E" h% N) ?7 X+ p6 d5 O( v
2 a8 @5 m# H5 z: h
if (iedom||document.layers){; J/ y9 e) u( b, q- B# c/ [
with (document){0 f( ]' |) P9 d
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
; h; R1 x* z B, z2 M: H% @. S, b5 oif (iedom){
" u) ?1 ^+ Y0 c* Uwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
c0 c0 u* R- L6 n6 N7 X$ Ewrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')) N/ A$ h- [% d' h
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')2 y2 Y- t! {. j& d' M/ o% H
write('</div>')
- {) Y( c0 G" s}6 _& g2 @# H+ j
else if (document.layers){; y% w* [; {9 }5 m5 i/ w
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
4 {0 c' S$ I1 e- ~write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')$ J4 p K# a3 ]' d5 l% a
write('</ilayer>')
1 L ?2 l0 F, X}
) Z. k( f: W2 C. ~, L/ Hdocument.write('</td></table>')' o' p4 A7 j* F/ J) Q4 l
}! f: ^% i4 W7 c
}; s# a8 W: s' Z9 I
</script> |
|