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

|
网页之跑马灯文字特效
//修改宽度7 C7 A7 e1 \2 @$ Q
var marqueewidth=300% c0 H' u' Y) h) G, U* q
//高度) R5 r2 l0 Q' G5 I
var marqueeheight=259 Z. {8 h4 q" [4 D. k
//速度(1-10)
, T7 g6 J' W9 M2 j9 Z. `var marqueespeed=3
$ M% D0 s# p# K0 Z//背景颜色; o0 [1 z8 h0 F1 S9 A
var marqueebgcolor="#FFFFFF"
5 C5 @9 T7 S& i//是否能暂停 (0=no. 1=yes)?
+ b% }9 f: P+ `% avar pauseit=1
" L' t- J/ D( c$ n2 W5 G+ E
1 ^2 L! @8 k! |, ]& g//修改显示内容
) A3 x, P) C- yvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
/ A/ Z2 S) J1 g: ~/ a1 e2 C8 P1 J
! d: X2 s+ M9 g+ Y; {& L( }////下面不需改变////////////. `' ~3 x/ X/ T3 ^7 w9 X! F: n
# [; R# X( i8 K0 [, y: _9 \var copyspeed=marqueespeed
' B: \( p7 G- c$ l4 M2 ^var pausespeed=(pauseit==0)? copyspeed: 0
0 J; `; L6 W) e5 l/ svar iedom=document.all||document.getElementById+ {+ g! P: A% T' N$ f* o
if (iedom)1 v% ]7 X$ t& X# L) |1 B" f4 U
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'), w9 r+ q& Y; D5 W3 K, G; R
var actualwidth=''
+ `. D3 a3 Q/ v7 j! m6 ~var cross_marquee, ns_marquee8 ?( l* S; h/ ?, ^: U
; b$ {6 B5 c3 e% B0 I8 A7 Zfunction populate(){
n; \4 L- X" H0 g& [: u2 i/ x4 a9 }if (iedom){& b% C/ v0 i S }5 Q9 \
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee, i, B6 c9 Y% w
cross_marquee.style.left=marqueewidth+8
3 `9 ?7 S' q1 `" x' U7 G6 zcross_marquee.innerHTML=marqueecontent
/ ~/ c) ]% w8 z$ j& Bactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
* w, \* \! n s4 [2 Z3 h}2 O7 [9 A+ M6 A `5 I6 f
else if (document.layers){
' B8 O+ }4 s: e" i7 p" b+ V9 t# Vns_marquee=document.ns_marquee.document.ns_marquee22 G. o) p: }) r' s) H+ H
ns_marquee.left=marqueewidth+8
7 h X9 B% y+ o2 S) p hns_marquee.document.write(marqueecontent)
( M5 W0 C0 \# ~3 D$ W( S* ]ns_marquee.document.close()
/ b, O; ?! x, Lactualwidth=ns_marquee.document.width
8 j( T4 ?, u v0 z% f5 _}. c# f0 q& @, a1 p- \- v+ t) |
lefttime=setInterval("scrollmarquee()",20)
) w4 i7 t( S( E, x: }* g}1 D: ^: H7 H5 _* v7 _' d) m& K
window.onload=populate; U, \5 j6 p) ^1 O9 `' g
2 n1 ~% j/ i0 U$ i9 Afunction scrollmarquee(){# ?' u" l8 O- a8 n
if (iedom){2 c# `! m& f0 B7 o5 }! {# G2 x
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
; u, g9 B5 R/ n1 G$ z3 mcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+ \4 k4 L$ s% o
else# u/ x! V5 o$ b
cross_marquee.style.left=marqueewidth+8
8 e2 X! P o) W; e; E# L; M1 x; E8 N( q: g7 a, [- d, ^. Q: V; U* M* S& [7 E- T
}
W: n1 \* V+ ? i. u0 s1 Aelse if (document.layers){! X4 M3 b F9 D% ?
if (ns_marquee.left>(actualwidth*(-1)+8))
) m) }$ a( m, \5 a+ @ns_marquee.left-=copyspeed
- a: c* } Q8 y. Xelse
9 Q! K% F* b" `: H6 S1 S" D; [ns_marquee.left=marqueewidth+8
0 P1 O7 @" i1 }}6 P7 ^1 J* j# k
}
5 _. J2 C' l9 n" ]5 s, s, ~0 l5 F8 ]; w K
if (iedom||document.layers){
2 N0 n& ~& f0 |& twith (document){( n) O6 _$ r% u2 F% G: h+ ]) ^8 L
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
( t: ?0 o) X6 l4 qif (iedom){* t* W9 A) s. a" S1 F2 X+ |+ N) S5 t
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
* u% @! x' @3 _4 ^; I7 a* fwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
. h T9 X) m( [; G6 s0 {write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
2 y+ x [& F: j. ~1 [/ {% O' X. A/ Hwrite('</div>')
6 i' E1 S- r' L}) p- k( p5 C: V
else if (document.layers){9 U2 H+ e0 f$ r! ^$ U0 N
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
4 f, F5 H% \0 [* F' o% Ywrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')$ N8 W& o) }1 f& {. l" Z: v6 c
write('</ilayer>'): ~( \7 j3 h5 f1 k o2 f
}
. X. y8 c* d5 u- y% qdocument.write('</td></table>')4 h" s- R, o' i5 F+ K, a$ k
}
! Z4 ^! V2 A) x5 L}- @* |) T* ` c( C4 |
</script> |
|