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

|
网页之跑马灯文字特效
//修改宽度4 z4 @5 N3 m: q& ?* t# V5 |
var marqueewidth=300: v1 ^ C1 l/ A6 Q% ^
//高度9 E5 [. |2 I( E- A$ w! d
var marqueeheight=25 z4 ^8 l+ P4 h4 J* F
//速度(1-10)8 |9 p" K6 U) O# O! u- D# i9 q
var marqueespeed=3
0 X, m- V. \+ N( H0 f1 K# m* E8 g//背景颜色
& Z$ A( J& n3 ]9 f% e- r+ U+ V) jvar marqueebgcolor="#FFFFFF"
/ l2 N7 ]9 P" ^- J! p) C//是否能暂停 (0=no. 1=yes)?
' g& M$ z- N z" Q: [# s9 wvar pauseit=1
. y* ?+ s& _( _% d# \0 S
1 Z* c3 W- M" ^; i m" `//修改显示内容
1 N" }7 x5 _2 _- n$ \# K }4 o, evar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'& o4 D' K7 {! X6 O9 X6 F
8 M" h0 I- v; E* ?: w
2 L2 s5 u* N6 S# s& U////下面不需改变////////////
! z! h: D7 b Z8 D, C" o5 W. q$ [) u$ M$ z6 }! [
var copyspeed=marqueespeed
& v T$ U* G" ?; {; c, P8 v( s2 H- nvar pausespeed=(pauseit==0)? copyspeed: 0, {+ h. K' [1 e5 E5 d& T4 Y
var iedom=document.all||document.getElementById1 e. X, P- ~+ P0 w5 C9 h
if (iedom)
& L; t, E) d7 k, n$ V3 ~2 `document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'): q0 x1 R h' T$ r9 o" f0 z
var actualwidth=''
5 X' j% q9 `0 I6 p: y: Mvar cross_marquee, ns_marquee
* p, f1 ]+ q' c! U. h" B1 O2 e& X, W
function populate(){, X9 G$ N3 I1 v, d- h7 N
if (iedom){, `9 q2 d# b2 b, P; I% F0 y/ ?" S
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee5 T% x4 f. F! l
cross_marquee.style.left=marqueewidth+8
; |0 V2 k2 i3 N% ccross_marquee.innerHTML=marqueecontent
0 V1 y8 D$ ]3 `6 n4 i: dactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
' J2 n: a, k3 E! ?6 w0 B4 j& E}" {8 H* Y" y; ~* d; k: [% x& ], F
else if (document.layers){
1 I. v6 d [- t3 C) {* Zns_marquee=document.ns_marquee.document.ns_marquee2( C5 _$ n% I5 Q/ c
ns_marquee.left=marqueewidth+8- G4 |; c; U4 j& J
ns_marquee.document.write(marqueecontent)
" d0 A: c% K/ X; {4 F3 w/ Uns_marquee.document.close()" O V& l) t& B& f$ N9 e4 P
actualwidth=ns_marquee.document.width
. a# t2 O, F# u( \+ V7 W& x# b* f9 X}
; g y6 T3 e" M0 W2 ]lefttime=setInterval("scrollmarquee()",20)
, ?. A5 R% w6 ^' X7 e5 ^/ r9 r}
( ?8 d9 g" x Q* X- r# \6 lwindow.onload=populate1 |+ [, x& K; r3 F N+ ^
. G9 k- F4 w6 N. `! P# sfunction scrollmarquee(){
+ _ b: K ]. F* z6 Pif (iedom){
+ [; S8 t y! x/ Wif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))% F/ k0 k, b8 W# a0 w
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed$ |8 j t% L- V# H" [
else- f# N) b$ W$ g y: S
cross_marquee.style.left=marqueewidth+87 N% f+ h/ I) A8 m; H
1 m8 N! I$ g' U8 U1 f8 A}
* r# @( q' P' d* ~- pelse if (document.layers){& x! }2 u5 b2 ~* U: p3 {
if (ns_marquee.left>(actualwidth*(-1)+8))- m, K L" K" M) I- @ I1 ]
ns_marquee.left-=copyspeed- W3 A# y# |1 x# w: G- c3 M$ A) G
else
" L, H) N( q3 M. O8 i" ^9 L! }ns_marquee.left=marqueewidth+8
( H& N+ p4 H/ |7 s; ?' Y}, @8 E9 B. @1 a5 [6 g) J
}
4 O' V' K3 k6 `' r' e! L3 j3 k* f
M4 K+ y' p/ m% o/ Z( Sif (iedom||document.layers){
" j$ O2 b0 D2 F3 ~. {with (document){6 ~; c0 W9 \9 ~ i6 w. R8 B
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')( P, P: _2 [) k) Z6 J5 @) }
if (iedom){( f1 C7 @! y6 D
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
0 d9 l2 I- A4 T8 Hwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
2 p3 }% ^ I+ r, Ywrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
+ c' e# U" h% Y5 I1 o7 q9 C3 E1 ]write('</div>')7 F/ ]6 I5 v+ J& k
}/ C V7 l$ |7 p5 {
else if (document.layers){
7 T8 X# ^8 y6 d1 g, E, r* Awrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
) J/ g: v9 R3 i- K4 d$ N) Swrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
+ w e, L' l; M4 W) N. Cwrite('</ilayer>')) R" ^3 l# v! `5 H/ a. S( `
}
5 j% `9 a- V/ a# j% wdocument.write('</td></table>')
$ q" K% z- ~$ ^8 C G, X( C8 E}! t: g+ U( M& }6 T; a
}* j3 n+ }. p' j1 K' ^7 i
</script> |
|