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

|
网页之跑马灯文字特效
//修改宽度
! q7 |& T' i3 q+ B! I8 g' B( C$ [/ wvar marqueewidth=300+ U {' J* R' C1 ]
//高度
0 b& x$ m* t- @, \$ I. J1 Fvar marqueeheight=25
4 I& u4 i$ p4 ~ F! Z0 I+ n9 N//速度(1-10)
5 Q- C; b1 O& ?2 Fvar marqueespeed=34 @/ z0 \" K: Y' C
//背景颜色0 g/ V' [7 K! z$ |: I
var marqueebgcolor="#FFFFFF"
5 v) P5 W5 D- ^& y1 `//是否能暂停 (0=no. 1=yes)?
, w( S/ |3 m2 n* f7 \! A: U9 Nvar pauseit=1
1 ]4 S+ d D% j, ]' {$ f& _! J1 l# y0 y6 K$ _0 L& W3 D
//修改显示内容
: x& Z3 q8 Y7 m9 `! fvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>': T$ |( H9 n3 |! o. o
; j) ?( U) O/ |9 E8 K8 P
& E& R* t! I5 W T9 V- `8 {
////下面不需改变////////////
: }& o& C% G6 C8 W' y6 c7 O3 a" I
, j7 W* I1 X. K! f7 @& ~, Nvar copyspeed=marqueespeed
@: R" k" o" Tvar pausespeed=(pauseit==0)? copyspeed: 0/ a) @1 f2 z& D4 |1 h
var iedom=document.all||document.getElementById
' B% ^$ `/ p8 U$ v8 Wif (iedom)* J' n0 d8 b A3 ?4 F, A8 V! r
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
- G, F, g, l ~- f5 fvar actualwidth=''
- ~: \: _, u- C# L8 v+ p8 cvar cross_marquee, ns_marquee
+ y, U& m3 B/ |, O; e6 q& v3 w: z x9 j6 ?; x0 B, c6 N
function populate(){- ^# L: Q- [. [, V
if (iedom){
% [1 S4 Z2 W! Y- ^* hcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee! U1 Y. S) X" z" N- [' Q
cross_marquee.style.left=marqueewidth+81 {+ r+ I! D! U
cross_marquee.innerHTML=marqueecontent
' A" m2 y; Y8 R" s4 g9 Y9 O" Sactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth0 P: K: E) P. c8 A. L8 n6 J+ f2 h
}* r0 a$ s1 K# ^, s' b/ r& t1 \: s
else if (document.layers){
/ \0 |* R9 o, `0 h7 ^. Ins_marquee=document.ns_marquee.document.ns_marquee2
! B6 o/ X7 q* i; L" Dns_marquee.left=marqueewidth+8
% c1 G9 c1 x9 _9 U7 dns_marquee.document.write(marqueecontent)- f" i3 W- h5 o7 ]4 S
ns_marquee.document.close()
. C0 E% c- B1 o# Ractualwidth=ns_marquee.document.width- e% s6 o# W' V" t5 [0 U* Y( h4 Q
}+ s( ~& I$ q' D c5 Q. F
lefttime=setInterval("scrollmarquee()",20)
+ `' w. T) t6 B' W& u1 n* o}
: w5 f# f; P9 I/ @1 Z3 E; Fwindow.onload=populate
5 ^6 M. g+ G/ _5 {( f5 j5 P, f2 n# b4 g3 r+ y+ m6 w/ D
function scrollmarquee(){6 j% V) H% T1 d7 `4 A( u
if (iedom){
0 h& t6 Y& P. j7 z5 w4 `if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))7 [7 G$ r! @1 j" n' u3 n' d/ x
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed9 X: X: O; L5 Q: D# @! X
else9 g2 I n9 |* B6 o" |
cross_marquee.style.left=marqueewidth+8
( N/ O9 R/ O/ K6 g: }0 `5 f
( B$ g/ i% Z5 i$ W}0 q; e; I8 y4 K) Q: H' d. h
else if (document.layers){
' N. {' U0 O0 @1 C' B- hif (ns_marquee.left>(actualwidth*(-1)+8))
5 j w6 C2 q2 T- Uns_marquee.left-=copyspeed
" I/ D+ f- q, lelse5 z2 A. Z! h, K8 k! v
ns_marquee.left=marqueewidth+8% B2 z; {7 b ?8 R
}& C& a7 p' s5 u5 {
}% r6 c9 O5 X) N R# b/ A
) B1 S) M$ o: n& cif (iedom||document.layers){
- {4 [- |; G% g" fwith (document){
' K4 n1 U& }( z8 n' L0 m0 `6 Vdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')) u0 c1 v7 U( a& S4 T- i
if (iedom){7 Y5 Z. i4 h. |# @3 l5 a5 J8 q
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'); N3 Z5 Q7 a" j. _: h) N
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
: j/ B. Y( t6 h o/ h* y H' \) uwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')0 ]' w: A, `$ _3 o p
write('</div>')
7 |& \6 s+ U4 T: Z( ]/ H$ P6 [}% v: j# A$ A% W/ A( a- @ R
else if (document.layers){9 ^" [! H2 A$ c/ Q {3 W7 e( K! b+ r7 V7 K
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
# U% C1 k; e5 u8 q" J2 rwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'), o4 i; ]8 B4 E$ I0 X2 j F
write('</ilayer>')8 f2 `6 |0 h2 a; t) h$ g
}
0 o; A- V" E: K7 ~ n5 ~2 Ndocument.write('</td></table>') |' g( ^+ @: w6 Q
}
5 E- F9 k/ S d, c6 e0 P& a5 u' H}7 l% a: ?& f. l: c9 v: t0 I' j
</script> |
|