网页之跑马灯文字特效
//修改宽度var marqueewidth=300
//高度
var marqueeheight=25~&m~Co1[j
//速度(1-10)
var marqueespeed=3$W)d'q9MZZ*\J
//背景颜色
var marqueebgcolor="#FFFFFF"Wt{`[N?
//是否能暂停 (0=no. 1=yes)?
var pauseit=13sT8bJGFn
gwF t)uJ'b m
//修改显示内容!p"qc8B4R @E+Bg
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'#t5|5bZ5U
XV(W,c8`
////下面不需改变////////////
var copyspeed=marqueespeedrsXk*\J7N5hE
var pausespeed=(pauseit==0)? copyspeed: 0 e)X;wEf%?8Ff
var iedom=document.all||document.getElementById
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=''
var cross_marquee, ns_marquee
$@ _y'Q1y+cC.t;X
function populate(){
if (iedom){4H(`L]/g.Q
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=marqueewidth+8O [\Pv&v6rG!oa
cross_marquee.innerHTML=marqueecontent!gAHzV9G
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
}}mt(bHp}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=marqueewidth+84qJv*Fn1F&E W%G%VEk~
ns_marquee.document.write(marqueecontent)/V HJ5@-sZno A
ns_marquee.document.close()X+Yer#a
actualwidth=ns_marquee.document.width
}3?iq-}Jk!m)l6K'x
lefttime=setInterval("scrollmarquee()",20) |v2C$KH.rE
}
window.onload=populate
n"x:dR#\R
function scrollmarquee(){ p7|lP4P#U
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))WFJ'I%dI+I
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
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))
ns_marquee.left-=copyspeedZ E ~q*GB([Z
else
ns_marquee.left=marqueewidth+8
}
}.U][&buSgN!}}
h9G#b+lV0`
if (iedom||document.layers){
with (document){
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>')
}
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>')
write('</ilayer>')(QE]%eI(y.@1vT/@(xn _
}(s9X)bq.k+sl
document.write('</td></table>')Qxhk2Z8o;A\
}*H2r7ru}e(RR2G
}
</script>
页:
[1]