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

|
网页之跑马灯文字特效
//修改宽度* p4 G9 u, J; Q
var marqueewidth=300. x" z9 Q S9 V6 O. j% m
//高度$ o/ M+ A9 H3 M" j
var marqueeheight=25* a: M( f5 d, \& l3 p# w
//速度(1-10)* _( ^$ |8 i' _- H, I1 ^% S
var marqueespeed=3 h& H6 y- y- R
//背景颜色6 I$ m5 U' ]. a& Q. t# R8 `4 y
var marqueebgcolor="#FFFFFF"# f8 Y; P# O" ]
//是否能暂停 (0=no. 1=yes)?3 w( S* i7 i' @
var pauseit=1
+ G7 b+ N1 q! a4 T2 M
8 t. U, B2 ?: N: Q+ b9 Q8 \//修改显示内容
. \6 H% [, j4 e3 qvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
! k5 v) m* p; A7 S# U& P$ v6 Q3 g( V9 b S, {" o
* Q6 B( Q# v9 I( V% y/ Q////下面不需改变////////////
/ {/ V4 {4 n J2 e1 }" T1 O+ z. x7 O
var copyspeed=marqueespeed! U2 |8 ^6 P9 s: ^' S0 H ^3 Q
var pausespeed=(pauseit==0)? copyspeed: 02 b* E- C) m7 _) D0 r2 T
var iedom=document.all||document.getElementById# |. t! B/ y4 k }' F: a
if (iedom)
K" m( t+ J8 k; j( ]document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')* B; b: O% B& _6 ]2 x
var actualwidth=''
6 T* z5 B2 T9 U. D V; {+ z1 @var cross_marquee, ns_marquee: V" x) K1 E% v3 f3 B& ]& ]
# h! P g- m& l' ]
function populate(){, i/ w& {8 }+ f9 L+ ]' {
if (iedom){% H- y0 K, I! q/ y1 X( O" F( ?
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
# x0 Q1 F: {6 _/ Ecross_marquee.style.left=marqueewidth+8
! |/ f( G5 G3 m8 i1 ^ j( B: \cross_marquee.innerHTML=marqueecontent
" R) y7 k1 T% A1 pactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth( X. y& H, R L8 g" Q0 Q, i
}
! i _+ e" `. H3 i0 d7 Uelse if (document.layers){
, K5 }0 @+ t. Gns_marquee=document.ns_marquee.document.ns_marquee2
8 A' [4 C* T r" ~# d2 n2 C* Dns_marquee.left=marqueewidth+81 Z3 C4 r1 L3 H* F
ns_marquee.document.write(marqueecontent)4 Z, j+ F4 `$ H6 F
ns_marquee.document.close()
0 g1 S4 Y3 F: t& u% [4 N6 Bactualwidth=ns_marquee.document.width
/ k3 x# q/ @' j9 T+ ]0 S/ o( r; S}
! {$ [, y- ~3 slefttime=setInterval("scrollmarquee()",20)
" f9 W" I4 U) C}( E/ r( ^- D, e8 r3 R
window.onload=populate- p- [0 G0 r' R7 j3 e9 e5 W
- N' z4 J# q3 D& A _) Gfunction scrollmarquee(){5 y7 x4 e' e0 l2 ^( t" X, R2 A/ a# z
if (iedom){
. o0 v: z8 }; ^if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
" U# [" P& `' z6 ^cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
, r. e2 Y7 N: j p Velse
) o4 B, A: w# x7 f3 ncross_marquee.style.left=marqueewidth+81 r% ~: N3 z* x0 [) ^
3 k `! H W/ w" N( P+ C
}' l0 Q5 A1 A3 @: e0 x
else if (document.layers){
1 X& m' M* _7 P/ Q+ Oif (ns_marquee.left>(actualwidth*(-1)+8)). @. ?& S) W' W, _% [, C: Y
ns_marquee.left-=copyspeed
6 r7 K6 K% M7 Belse/ F5 Z8 d2 p0 I. R5 m5 ~
ns_marquee.left=marqueewidth+8# }, x: t% H" ]8 a3 M; M5 ^2 f0 i) C
}6 \& k1 m& j7 G- d
}
, i0 w8 |7 Z" x1 w5 F/ I* L9 C2 Y- S( q
if (iedom||document.layers){' s, N% C) _6 Z: t# r' ]
with (document){
, s, |2 K& K/ b4 tdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')2 O+ }. ^8 w# P( K0 f, b+ a! b
if (iedom){" ]% O* i; ^& ^4 x! K
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
/ s4 q; C. U! Z% w$ @! awrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')! ]" K! f9 ]1 `
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 |* F! D, _+ ]0 U) I7 ^write('</div>')
% T& g" V4 e3 _$ {+ F}$ t' c5 U1 v* _6 M
else if (document.layers){6 a# E; s F$ T- U
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')1 Y: X7 q2 i$ c0 g4 f
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')( I% G* u0 L7 D/ G) M* ?7 ?' p
write('</ilayer>')
; Z7 k, ~" S3 M8 y) u( ^2 w- \}
9 |. H3 j( S, ?document.write('</td></table>')! f. ~) ~' K a/ z& j
}
2 x% [7 y: ?% j5 c2 E" a: G}
" z) ^ E5 |8 x. K; _8 [</script> |
|