捌玖网络工作室's Archiver

zw2004 发表于 2008-1-21 20:53

网页之跑马灯文字特效

//修改宽度
q~&sbv&S7L;U var marqueewidth=300
@5i(_,m,spO9C //高度
"m-H7y|5_$P var marqueeheight=25~&m~Co1[j
//速度(1-10)
S:] iL H8I c var marqueespeed=3$W)d'q9MZZ*\ J
//背景颜色
krm!c#` var marqueebgcolor="#FFFFFF"Wt{`[N?
//是否能暂停 (0=no. 1=yes)?
{l8D~CR hWz var pauseit=13sT8bJGFn
gwFt)uJ'b m
//修改显示内容!p"qc8B4R @E+B g
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'#t5|5bZ5U

mc HvTp y7w XV(W,c8`
////下面不需改变////////////
c:].h Z {+w&]L
oo!G&Y;G var copyspeed=marqueespeedrsXk*\J7N5hE
var pausespeed=(pauseit==0)? copyspeed: 0 e)X;wEf%?8Ff
var iedom=document.all||document.getElementById
R bhl7ss if (iedom)c NN;rR!}of
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>');u*_~a{P9ge
var actualwidth=''
FB"\U&sO$k(D'YD var cross_marquee, ns_marquee
e8t.z'L'M#As| $@ _y'Q1y+cC.t;X
function populate(){
z#B$U_:v4L if (iedom){4H(`L]/g.Q
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
M gP&y6h B5z'@A cross_marquee.style.left=marqueewidth+8 O [\Pv&v6rG!oa
cross_marquee.innerHTML=marqueecontent!gAH z V9G
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
? Pw+F Y1b:m\J }}mt(bHp}
else if (document.layers){
3W,d1{F)uI t ns_marquee=document.ns_marquee.document.ns_marquee2
Fp N(iY0Q|~ ns_marquee.left=marqueewidth+84qJv*Fn1F&E W%G%VEk~
ns_marquee.document.write(marqueecontent)/V H J5@-sZno A
ns_marquee.document.close()X+Yer#a
actualwidth=ns_marquee.document.width
X"}\'o0~R }3?iq-}Jk!m)l6K'x
lefttime=setInterval("scrollmarquee()",20) | v2C$KH.rE
}
z%uUdB%y` window.onload=populate
8~+g'{.|gU n"x:dR#\R
function scrollmarquee(){ p7|lP4P#U
if (iedom){
L+D/k5s,i Lt` if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))WFJ'I%dI+I
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
,S#M2j#`;xI elseOcv6]tbC
cross_marquee.style.left=marqueewidth+8I-BRVD
1M O R @+h@p
}Dl:[2t8Y
else if (document.layers){A#e!Cw3s M+A7xP
if (ns_marquee.left>(actualwidth*(-1)+8))
)N)}6c0hk9Vs ns_marquee.left-=copyspeedZ E~q*GB([Z
else
du.li%T ns_marquee.left=marqueewidth+8
\1vn:qZt/} }.v }
Yh/E0Ua }.U][&buSgN!}}
h9G#b+lV0`
if (iedom||document.layers){
VYU0J/bz5x${ with (document){
0u-zDpA e:s2F DO document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')(lCx8fK!L5Y
if (iedom){Y2H*c.M ?'|{
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')7}~Vn#Fi5g
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')D:K*\,b-`jo R+\
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')(yQ@1OyN|
write('</div>')
JWRM AHu8u }
Q#X&G6~$h else if (document.layers){2f@4B7Izh3]3SHSb
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')/d9J.s9Y]O;?|7LB
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
S Zh+[:U write('</ilayer>')(QE]%eI(y.@1vT/@(xn_
}(s9X)bq.k+sl
document.write('</td></table>')Qxhk2Z8o;A\
}*H2r7ru}e(RR2G
}
A)H-Ua"u%~#^W6K </script>

页: [1]
【捌玖网络】已经运行:


Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.