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

|
网页之跑马灯文字特效
//修改宽度8 ]; D4 u8 f2 G& h7 z
var marqueewidth=3000 _5 x4 @% r( W# ~/ G" q7 D
//高度. z2 v+ O# N: F' X
var marqueeheight=25
5 \8 E! V1 q* \$ V; Q3 J//速度(1-10)
$ x( X( C! l# ~7 n9 L6 _var marqueespeed=37 z; U4 S8 V3 h( X, d# I
//背景颜色
6 T, S3 s: u# t) i: K! H4 Qvar marqueebgcolor="#FFFFFF"
0 ]8 `" L: a' \* V/ O//是否能暂停 (0=no. 1=yes)?
, o, W- R: s! r9 d8 C: T, F5 fvar pauseit=1: c8 R% H$ X: R4 ^' f
$ C8 T$ Z* W( Z0 V0 z5 ^//修改显示内容
; L# y$ P& D1 m9 X/ T" X8 p: Cvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'; d; G1 ]% A; m2 V9 w: s
, ~9 V% B& t$ K9 L
, c: q' p+ R- w2 P+ L. U+ z- M////下面不需改变////////////
( O, Z1 @; }( V+ d8 P. e) ]9 m5 |, H" \$ C' H
var copyspeed=marqueespeed1 c; Q6 V& c1 J
var pausespeed=(pauseit==0)? copyspeed: 0
/ p& K1 H& l8 ^* S7 fvar iedom=document.all||document.getElementById
5 p& \8 p5 e7 D( H% q2 |( a$ ], ?7 a0 h# @if (iedom), B0 A9 `. }+ p- J# \& a
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')' v' v- R6 K+ |: |! J
var actualwidth=''/ M! U* m* [0 x/ i9 t/ l3 R$ Q l
var cross_marquee, ns_marquee+ J) ?2 Q, A. {9 A
3 x. @+ E& w: o$ s g% E& N- I1 _
function populate(){
( i) O) M1 @3 h. `# i6 n; o( iif (iedom){& F3 G8 A( P9 v+ [+ @
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
3 T# d+ p! X( c4 G, ]$ s9 K7 C6 fcross_marquee.style.left=marqueewidth+8
0 R7 S" a6 ? a- }cross_marquee.innerHTML=marqueecontent
) z, G) J& @+ tactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth5 ^6 ]* U+ \. q6 N7 |
}) u% _+ D ~+ y! m! N! G
else if (document.layers){
C& u& t: z- P! Z# R1 H0 ?ns_marquee=document.ns_marquee.document.ns_marquee2
" o. c" f0 _! M7 m' l* ins_marquee.left=marqueewidth+8
8 E8 q# f8 X! u6 `1 ^: z, I: D @ns_marquee.document.write(marqueecontent)
' b! G( j, ~" `( Dns_marquee.document.close()
2 n2 S8 m; o8 Iactualwidth=ns_marquee.document.width
8 F8 O% t8 @$ u' j* v5 b- E}
h, K. C! i3 p4 r2 Rlefttime=setInterval("scrollmarquee()",20)
5 w. p B; s5 s}3 {( ~, g4 l, H
window.onload=populate
! B& D4 L" U) N( s! u- x9 T& T( D, Y8 D$ S
function scrollmarquee(){5 F/ `/ W( I6 k* l; A a$ J
if (iedom){2 x6 [( A3 k& K) U' Q
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))/ I( S; b6 h( `: W
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed4 v# e1 y& j; P+ M/ |
else/ r! E7 t6 z& y
cross_marquee.style.left=marqueewidth+8
- x$ T3 N. t" h8 @7 B" [+ O8 f- G8 x4 |& E' F
}7 I7 y# P* ~, W8 f& o5 @. h
else if (document.layers){
0 E* q; d0 L1 p% @5 ^if (ns_marquee.left>(actualwidth*(-1)+8))+ n- z5 ~; B' b! N
ns_marquee.left-=copyspeed; B0 |9 n. Y! Z G/ @& t+ e- M5 O
else$ A c# {( i8 G0 j/ z4 G/ K2 L& W
ns_marquee.left=marqueewidth+8
5 q7 n9 Q/ F) f3 |3 h6 p2 p9 W" R( }}
. T$ |% E# u. K/ A, S}
6 D, Y+ K% j& K( Y7 W( y
$ h) \8 K9 M& B- aif (iedom||document.layers){
% K' c" z- v) ]9 d+ }' Gwith (document){# i, m6 a+ @6 j2 b) n+ _& w
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
+ D9 M# y! p# T5 E, s# f6 V; v' T- {if (iedom){
% M) k. p! R0 K8 i' @write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')3 F/ ^4 @7 I5 }' ~ _0 \
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')/ O1 R7 _- Q% B0 G1 c7 k( S' N, o
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
6 a% Q& z1 B! T# z% ^; O7 pwrite('</div>')* \! T, C8 R! C5 J" t$ h% ?
}
# J' j2 a8 L" A0 u3 @/ [else if (document.layers){& M% Y! a8 [" T2 j
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')9 |, V' ~: S2 D* Z8 v$ {: g4 K9 ~
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'). J: r, w5 A* h# H, e% `
write('</ilayer>')
% v. o6 E% a, F1 A3 T7 ?; Q$ f, y}) v- Y# L& n' f, z8 R& m4 q
document.write('</td></table>')6 Y. ^* I5 i+ F
}! `( x( b$ W, I. j8 }7 Z: @
}$ k' u1 h$ m/ c& d/ B& G H$ I. Q0 |
</script> |
|