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

|
网页之跑马灯文字特效
//修改宽度5 a- D; k5 O3 o, W3 F. B& J
var marqueewidth=300
, I5 H4 d, j4 `. h- \+ y% I/ }//高度1 `" P: f9 ~% s" i4 o4 r, ^& r4 S
var marqueeheight=25
" |" b" h0 I k//速度(1-10); Y! l/ T/ B; X5 A8 |; ]# C, o
var marqueespeed=3% E3 U' [5 y9 J) h0 {0 P7 n
//背景颜色* p# _% v- _: u$ e7 i
var marqueebgcolor="#FFFFFF"8 N. g! Y# [+ V8 X" x3 D
//是否能暂停 (0=no. 1=yes)?0 a7 u7 V* F# Y( ?1 Q
var pauseit=1% ?: c- a; X2 c' l5 u
3 n; D- V8 {& F2 @
//修改显示内容
. s" I& D* O* n) Nvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'* P/ E+ W1 q5 q7 X. {* ]- _
' {3 J3 u: {1 ]- [
9 {; Y5 u1 n' j* [! D& J5 A0 u////下面不需改变////////////
5 `% m: O, i- U6 k. J; F# _6 ]( R; F& M6 v
var copyspeed=marqueespeed0 w& u) {4 d2 Y: _5 z3 x
var pausespeed=(pauseit==0)? copyspeed: 02 t8 }! A! Y4 c1 K" h: v8 ?, m
var iedom=document.all||document.getElementById) |- o+ f" D$ Y' P
if (iedom)3 B! b2 b* M# s
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')2 A: y: V+ o$ g& k! F8 m
var actualwidth=''# w* l2 R8 u% o6 _8 j' k. L
var cross_marquee, ns_marquee
1 R1 ~& b' d" u& G, b% H- @0 W4 D U) p7 v& [
function populate(){
9 e# \# D9 B$ Kif (iedom){
) l+ m6 X. w; N* S% \' A9 ecross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee; d5 N8 b: Z. g: A- B7 `+ T4 r
cross_marquee.style.left=marqueewidth+82 q' D! L' b) l
cross_marquee.innerHTML=marqueecontent
; e3 ?. m( c% D7 j' wactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth$ `6 R% n8 l& W- K) r
}; Q. E h, g! g( U" ~4 l! L
else if (document.layers){
8 q6 c+ @/ g+ g6 }, Mns_marquee=document.ns_marquee.document.ns_marquee24 D- j5 a& k4 l) F! y) n5 ^
ns_marquee.left=marqueewidth+8
- W' l. S* ~7 H6 Yns_marquee.document.write(marqueecontent)
) B3 G, P) h r' K2 ~" `ns_marquee.document.close()1 F7 O G* U* {8 Z2 Q, l9 H _
actualwidth=ns_marquee.document.width
! }2 z, F; u; @! u5 r* V' O}
# w& {" i) x; f; `- H5 _! blefttime=setInterval("scrollmarquee()",20)
0 P/ p, i/ o9 M# z- c}: T1 U; \6 i0 v# ^4 y( P
window.onload=populate# W: e4 k4 D7 }0 u3 \
0 A% u7 K- V) V9 L3 @, efunction scrollmarquee(){# }$ V! i( ?0 x- A7 ?: T
if (iedom){) y. Q3 R, p6 C, J# B1 M2 n
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)). C3 n0 v- e. |- U. f5 }: r* T
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
! Q$ M* T1 |# V9 r6 p9 Lelse
* j: |3 J/ Q7 @! J Zcross_marquee.style.left=marqueewidth+8
* v; n) Z0 j4 @2 \; Z. O7 g
" l$ t* f4 w- ^' C* I" K3 q( O' l}5 Y6 p4 Z: |, k* W3 P
else if (document.layers){) S$ x: D. b) K- B% j. r
if (ns_marquee.left>(actualwidth*(-1)+8))
- x' i; X6 _: _& U0 r F% ins_marquee.left-=copyspeed# D* h5 S* ?5 k6 D: P8 y+ a( n+ M
else m; D* C) Z4 X7 S: b3 D
ns_marquee.left=marqueewidth+89 |' n9 T9 ^$ F
}. e4 w2 H8 r6 G9 Y# R
}
) q3 ~3 @" H/ T+ e; V' z; ^) m* `3 e0 m
if (iedom||document.layers){9 I8 v1 }, m$ q& [, ^
with (document){8 b, m) c3 Q6 S2 [* R
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
, h" h' r5 K' z/ m1 E' z4 Mif (iedom){
/ J( h+ A ?+ C& m; `write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
4 b2 l- g" l* e* r3 jwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
" Y( N6 L# n" L7 h5 ~) ]+ q& _write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'), d/ O$ u5 \6 g4 |: g) }2 G/ u* B
write('</div>')' U: @+ N% M( {+ W
}0 C8 G# H: Z5 n h+ `6 F
else if (document.layers){
9 e; k0 [+ Y% G) L* O, y+ D1 R; Bwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
& j @3 ? V$ B: W, h- V1 Awrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
8 c. v. l, O/ pwrite('</ilayer>')
% G6 \8 W% {0 ?}
+ O/ C2 j& i0 H/ a3 q4 Sdocument.write('</td></table>')
8 X5 r* c% t5 K}
; ?; `+ O5 h7 R$ h}
: Z! ]: I9 P" W c0 I</script> |
|