获得本站免费赞助空间请点这里
返回列表 发帖

网页之跑马灯文字特效

//修改宽度  w4 u; _, o7 A
var marqueewidth=300
& X% w  H# V2 T8 x8 l% T: {5 g//高度' p; K& t6 q2 b- G
var marqueeheight=25
( _: G$ p  _7 r! C1 ~1 Z# b//速度(1-10)
2 M) T! l3 s; Y9 n; ^0 l' b9 i( [1 Rvar marqueespeed=3% u" H; k6 v1 t% L( F
//背景颜色) t0 f6 B$ p2 c( ]/ R
var marqueebgcolor="#FFFFFF"7 k; @: a; ^- z
//是否能暂停 (0=no. 1=yes)?( @# s3 e8 X. P- ]/ _( O
var pauseit=1. ^% }0 [8 f$ n' e; {

/ D& F3 h: H- g8 J//修改显示内容+ C- W& M. {( j0 e
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
% y) v* [& L; m% c1 C- O( g1 ]. `' o+ S( ~

/ H# f' e. H. o8 R. S////下面不需改变////////////
7 N/ F# M: s9 O! F6 r; [# Z! \% t: ~' W. g. s; ~$ p3 Q) q) P, l( M
var copyspeed=marqueespeed
9 X  q7 c; e# i: |+ A% ?- z" Mvar pausespeed=(pauseit==0)? copyspeed: 0
2 l& v2 I7 c9 F7 r. w. C. Yvar iedom=document.all||document.getElementById% R  Z( G# g( z8 B- l
if (iedom)
5 E  X( B! E- g+ g, |3 I) Fdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
+ ^7 u' E5 Z/ i, C" k. U& Gvar actualwidth=''% s* r- R* L$ g9 D
var cross_marquee, ns_marquee$ Z9 N3 N( X! T, u  m
$ Y4 R4 h* I! r7 z* B$ _, y
function populate(){
3 Q* M* `4 Y- iif (iedom){* X/ B. d3 y9 Q  K
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
7 \5 b. E4 }! k' p0 v# A4 s% U9 dcross_marquee.style.left=marqueewidth+8
7 X6 r! J" D8 t/ q; I% Tcross_marquee.innerHTML=marqueecontent
$ M0 s) T" ~0 f7 n+ qactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
7 F/ K' b8 r0 i6 _' u  I8 y}* r  x" y# P, J
else if (document.layers){. k, B$ V7 j" O; n7 c8 v
ns_marquee=document.ns_marquee.document.ns_marquee2
% l9 S/ ~2 P6 kns_marquee.left=marqueewidth+84 i6 F& r/ E6 o, \
ns_marquee.document.write(marqueecontent)
$ H! y% S) N3 ^" U7 S5 u/ ans_marquee.document.close()0 e" p5 O' G5 o% `
actualwidth=ns_marquee.document.width% V) K0 i* H0 P/ i2 B3 I. @
}
) I. E( I0 @8 R: Plefttime=setInterval("scrollmarquee()",20): e& C9 c/ }- ]8 G
}9 B2 j& l& g* H) H( B' _
window.onload=populate2 P# N' f  o& `- l) u9 _& K+ W
. H4 s) k3 O# t8 d' d
function scrollmarquee(){- g* H1 Z7 ?4 T! \" Z" f
if (iedom){* ~, }4 y/ U% u! G5 u3 f  I
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
4 j3 S( ^. }* T: g1 T6 Across_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
/ O3 U% Z) K! q4 Celse
1 G; d4 s% L+ Y$ fcross_marquee.style.left=marqueewidth+8
; r% Y) a# M5 h, {: A: _0 V7 `1 |! h# Z# F/ Y2 F- \
}" ?# n  _1 {* E4 Z7 h! E
else if (document.layers){/ `8 ]6 b) B. H, y0 M; k
if (ns_marquee.left>(actualwidth*(-1)+8))
. z4 {3 ]! I+ s4 U1 W' Kns_marquee.left-=copyspeed
$ @; F: y2 s% c3 @& H7 T5 F$ k) selse5 Z) w4 }6 V7 k% z5 [% x' K
ns_marquee.left=marqueewidth+8: P' f1 c3 T+ Q6 r9 N* D3 P4 v
}
  E! p- i, b% g, X& m2 U}
1 a9 V- K9 u. {8 E6 D4 o" [# ^+ ?  e" W) S" Y
if (iedom||document.layers){
% \" u4 |4 U- t- Lwith (document){
$ \4 }0 q, \$ m* b$ ~- `2 B- Odocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
2 g, Y6 d, P7 {& W* V6 vif (iedom){5 `7 v/ |8 i  V# J/ i  b% _- P
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'); u6 j8 K: `0 `  D4 Z$ u* ~4 u3 [1 U
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')* g) u# F; Y3 C1 p9 G
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
% {1 l0 I5 t+ V4 \  Mwrite('</div>')6 V# x/ P3 C2 z) O, M
}
. Q7 G6 a* [) ]2 d* Y) Aelse if (document.layers){
" t2 \: G  n* \6 [: `write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')8 i5 N2 X( m  r+ j" m
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
. K/ a' u4 M3 _4 y" p6 J% Iwrite('</ilayer>')% k. h/ a% `$ h0 V
}
) y( L& F- z! _3 fdocument.write('</td></table>')# u! [- ], \, f& R- h/ d$ V
}
, z" z/ C% [( C}* @$ x8 Z, S$ U' V* I' j' ^/ \) t
</script>

返回列表
【捌玖网络】已经运行: