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

|
网页之跑马灯文字特效
//修改宽度
; f' q9 {( R& r( @var marqueewidth=300
9 Y; h4 V" U, c//高度
3 W2 B! Z( }( u3 [var marqueeheight=25
' O' P7 T0 E4 k( V//速度(1-10); G2 h B# I" [8 h( v/ C! ^
var marqueespeed=36 r" H" K+ W! j' `$ p0 r# R
//背景颜色5 W' j( n$ l& R9 W+ [. Y; F
var marqueebgcolor="#FFFFFF"6 Z$ y" @% W% v$ @
//是否能暂停 (0=no. 1=yes)?) ^- ^3 n8 _# G) b, K, ?7 r+ u0 k
var pauseit=1
5 ?7 O; }6 F; u3 u" T1 y2 Y1 d0 X, U! P: o
//修改显示内容9 X' ~% k+ I3 M4 j0 v( B$ k% w! L
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
/ x! z" ^4 M4 e9 d D0 K" S: m2 T$ O: _0 H( ~1 u) l5 t m9 ~
; j; x1 U/ m p" P////下面不需改变////////////
( U. d# m- c. ^3 Q1 R) m. H9 L3 B% X# \
' h7 x1 G* f. d% u% W% [var copyspeed=marqueespeed
9 N$ k+ E# t0 o3 E, C9 xvar pausespeed=(pauseit==0)? copyspeed: 0
4 b) s& ^& o% [. {" mvar iedom=document.all||document.getElementById
3 k; H4 W& p4 n5 C3 e: x% J& Q. Jif (iedom)9 _! B/ G: h; B: N% X/ y4 ^2 S) o6 `
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')- @/ \ ?# S0 @
var actualwidth=''
8 `4 m! p' G' S% ^% D, _. Wvar cross_marquee, ns_marquee [4 m2 L; u! C( S8 [
' V+ p' b0 N( v+ w' |. J2 Z
function populate(){, {1 Y2 s4 l' N s2 Q9 O
if (iedom){% K& A& v; C& V
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
1 H5 m% u) C* i9 G! bcross_marquee.style.left=marqueewidth+8
8 i1 Z* e9 x1 z0 r' {! D4 N; m8 ?cross_marquee.innerHTML=marqueecontent
0 l4 S$ O) K7 n, m6 E% dactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth# M9 X. l) J3 l% B/ N9 ~
}
5 a6 D; Y) l1 w5 ?, u4 ]else if (document.layers){# ?7 D3 M* R* x9 L
ns_marquee=document.ns_marquee.document.ns_marquee2
+ O; |' z3 o: a; Z F3 ^; Lns_marquee.left=marqueewidth+86 F1 B) Y& l. ?, h S" v
ns_marquee.document.write(marqueecontent)- o* M/ ?* t3 O4 B0 v7 b q
ns_marquee.document.close()
2 P7 p* ?9 L% G! y3 A" pactualwidth=ns_marquee.document.width+ x) s4 y% N, e' v/ E& l
}, A6 `) Q8 l/ T# `5 ?) j0 B; c
lefttime=setInterval("scrollmarquee()",20)" ^" v( A9 k0 |* d0 o
}4 l; p' X. U7 k, N' R5 z: |, g: u. Z
window.onload=populate
2 a v/ W0 k* {" z" \ i7 \* z" _' s8 I2 L: [( w8 z7 ^, r
function scrollmarquee(){
" h$ |- d2 l; e: S; \; Zif (iedom){
" v' K* S, t) c3 |if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)), z. s/ E7 r6 F1 q* R0 ]* s
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
( w P0 `: g" ielse
+ {- s# L6 Y1 k8 R8 {! ycross_marquee.style.left=marqueewidth+8
6 Z, w6 {1 }( l4 X0 A' `$ h* F3 A% I0 J t3 p
}7 ^9 y) t7 P, N1 H. f
else if (document.layers){% f9 Y% n9 c+ u% c& H7 N- y9 W7 w
if (ns_marquee.left>(actualwidth*(-1)+8))
# G6 g0 ~, q& Q& ^# xns_marquee.left-=copyspeed& \& i. X; u5 c8 D$ @) }
else
3 U. O8 J2 c! K# C9 E qns_marquee.left=marqueewidth+8
0 {% z. N! r' t4 N}* B+ w- h s3 g8 Y2 @. z! d0 Q
}
% m1 v* t2 w3 I& Y: q
' p# m" J) ]5 ]if (iedom||document.layers){" y. F7 p! ^9 [ |& z
with (document){
7 | t4 R( X: {+ ]4 }9 d6 J& H3 Kdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
+ `! @, l- }$ D) n- fif (iedom){
; N% |' m4 T/ q3 b& y- {" R5 jwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')$ n) C3 h+ D: @8 _/ F! J" w
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
" C6 K! U; \$ q1 e- Y0 M- Wwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'). K N0 s2 q0 b% D N& v4 ]
write('</div>')! O1 j% {7 F' E" l
}
* E+ I4 c) E% _" X: k) u5 Eelse if (document.layers){8 O. k6 n, I" s
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')$ N- L x8 E' D' u) S
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
4 L: F9 W1 e" E/ Rwrite('</ilayer>')
9 b( B6 Z; x. k8 o1 g$ d}
( b0 ?! D, w) K. u" \document.write('</td></table>')+ E& C! y* g+ ^, F+ [. [7 L0 |
}1 ^4 F4 l* B! y" i
}9 i' d" L4 T. |
</script> |
|