网页之跑马灯文字特效
//修改宽度5I[Gocyvar marqueewidth=300:L#em.\v,X1]1d d X
//高度k#g([,Ar!TT f`1I
var marqueeheight=256qP?5]x4G
//速度(1-10)
var marqueespeed=3
//背景颜色
var marqueebgcolor="#FFFFFF"
//是否能暂停 (0=no. 1=yes)?
var pauseit=1
/J&Zl*~a$Fo
//修改显示内容
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
}h-kg8{0`
%FD)Y8wYM
////下面不需改变////////////7s\&@M&Q-j8?\n
var copyspeed=marqueespeed8N o`vquJ7XJ
var pausespeed=(pauseit==0)? copyspeed: 0DF&{ V*\D%a6`4S
var iedom=document.all||document.getElementById*Rfc@sB
if (iedom):T&f)a kmf2HJ@ i
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')t8J*GJ8~%|
var actualwidth=''2v:UGKdi%x
var cross_marquee, ns_marquee
7QL9l;fK`jiB
function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=marqueewidth+8
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidthQQ6_O?
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2H/^_G&Z
ns_marquee.left=marqueewidth+8P:nyr5J,E)r.sh
ns_marquee.document.write(marqueecontent)k5[7`UO-F0@
ns_marquee.document.close()F1^Y:?h| v@&z
actualwidth=ns_marquee.document.width
}{L7i _+YG F2dG
lefttime=setInterval("scrollmarquee()",20)k!pBb4?7r
}(rb YY,w e0j
window.onload=populaterwY#U5BW
function scrollmarquee(){?ic"S*e8rX~}&Z
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))"Qz!C*O9Ld[
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed^8Y3~ @8HXZTg
else"lH7Nw}4n
cross_marquee.style.left=marqueewidth+8
`;_$z\:i
}m+N2v b'P
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=marqueewidth+8] yQBh}Bb
},V\ju$Dp
}KO;U}I1h2D
9h8i } F~
if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')7D5K2xS6us?p1^
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')5q%F)Hs%^
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
write('</div>')C@MM_pFx:wA
}u7X ? lfU
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')k2SsX4p`4C
write('</ilayer>')
}
document.write('</td></table>')
}`%q |L }5i;p
}*U3?d3S9y-?J1Ov
</script>
页:
[1]