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

|
网页之跑马灯文字特效
//修改宽度7 L C# k) s/ u& o& z6 S
var marqueewidth=300
* [3 X- B6 |) ^" ]5 j8 v3 _/ @# S) A//高度3 O& x8 E- u' L4 |
var marqueeheight=25$ E E) e) \# v3 t/ K2 M
//速度(1-10): F, A* a3 z9 c# b& l
var marqueespeed=3' j7 N$ E; K+ q! i! f
//背景颜色
0 z, q5 i. e& O( g& C: jvar marqueebgcolor="#FFFFFF"
+ ]$ [- O9 C- f- W//是否能暂停 (0=no. 1=yes)?- I" F8 R4 a5 l' Q" R1 H
var pauseit=15 }: G5 X0 E4 D0 I: t5 I
" d1 r4 g( O! b3 O9 F//修改显示内容
: B2 q. A1 x$ w* C2 u; ]var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'' K; n( i/ l$ E/ ^
+ f3 O* O0 K! e/ c* Q5 H" B/ N0 P) c# G! [6 M: L4 I& X8 j
////下面不需改变////////////
" i J7 ~/ l4 ?
7 O3 ?4 g- t& f$ m, avar copyspeed=marqueespeed
( B4 d; n% A i" z- h7 \var pausespeed=(pauseit==0)? copyspeed: 0 {3 w! G6 s1 c# P
var iedom=document.all||document.getElementById: w3 m1 N P7 m9 N: {6 ^4 @, W
if (iedom)
, C7 w0 @1 \! r n+ Q5 t' M9 tdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
( l* G. r( D/ t( G4 p( b' i# Wvar actualwidth=''
* @) `& l! Z' e, ^% a7 L5 k; Avar cross_marquee, ns_marquee: y& h9 E) {6 E) ~
' v9 J* M; l7 x' o9 M) @
function populate(){
) i! E1 G# F5 v* Z% _2 {6 `- r& mif (iedom){
$ n0 I9 u: C3 ]' M6 O2 T. lcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee- Y4 C& F7 l% F2 a
cross_marquee.style.left=marqueewidth+8
. }% B. _. s& {+ m7 Y3 z% gcross_marquee.innerHTML=marqueecontent: ~' Q0 x+ z0 X
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth* W3 [' p6 n2 [- u7 v6 T
}$ R Q( B% {0 b7 b. \# Y8 O; S- `
else if (document.layers){
?( ^5 ^* D6 T6 }$ p9 uns_marquee=document.ns_marquee.document.ns_marquee27 \' j% O5 V# i$ o$ P" g
ns_marquee.left=marqueewidth+8# r7 ~* F+ g) ^; s5 T
ns_marquee.document.write(marqueecontent)
) o9 ~; F# A5 I& m/ L- f1 gns_marquee.document.close()# B( q' w& Y5 M# @# {- b* R- W
actualwidth=ns_marquee.document.width1 S% g t4 p* _
}
. S$ L1 ^2 @. flefttime=setInterval("scrollmarquee()",20)" t8 |7 n: X1 \1 c1 f
}
5 m6 M3 f( p4 o" \3 u- |window.onload=populate0 s5 t5 S, A; F+ W/ h. Z
! m0 V N' W/ d$ b8 n4 S& b2 |6 Bfunction scrollmarquee(){
8 B; ^& c+ A+ C% Hif (iedom){# m/ `) U! N6 P3 V, {
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))0 f+ x/ D, N- i
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
0 |, l0 S1 g# Ielse
" Z: B2 C4 b7 n# ]cross_marquee.style.left=marqueewidth+8
8 c$ B: X, b0 ^, c. t" I+ r; p
, W2 k! U ?. X" |: w( l" m}
T. Q1 o- j, Selse if (document.layers){
5 M `3 |: s+ V$ I; iif (ns_marquee.left>(actualwidth*(-1)+8))2 c7 E+ _# ?. S2 a5 F: i8 [6 n% q" k
ns_marquee.left-=copyspeed
! R. h. A/ \6 L) q( velse0 l+ N6 d1 U2 x; e! y! ?4 v
ns_marquee.left=marqueewidth+8# u* O# ?5 n* W6 T ^
}
; R6 }7 m& k; Q4 i: x) s3 d}
* G" v+ {" w" }4 v" L" v4 n- t2 a. ^' N6 h4 t( q7 M7 L0 }
if (iedom||document.layers){+ ]9 l+ ^, H* j# A0 }& m
with (document){; R4 Z! `( C, E: y8 C# A. G
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
1 N+ q, L# R, q P/ J2 j1 Lif (iedom){0 {1 r# k) k {5 Z. E/ b1 [
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
2 s/ K4 a5 i3 Vwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')9 p5 m) i6 ^. _. |1 j
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')5 ^4 D8 O0 L( H. K$ h/ |
write('</div>'), _/ C' @: {, A; u% ?$ L( I
}+ n0 p# z- T. t% j5 V+ W5 r
else if (document.layers){+ G5 @3 z* b7 u- E# J$ C+ l; M7 q
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
8 p6 c- A0 ~# Vwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')/ y3 M1 y, G& J4 i0 c
write('</ilayer>')5 J5 o7 t1 |9 ]' V
}+ s5 |+ Y9 O% c Z( I
document.write('</td></table>')$ z' f+ F9 q- |
}' [. _7 g1 P; |
}
: c3 u v$ p8 _% X# I- {' L</script> |
|