网页之跑马灯文字特效
//修改宽度*YR3}&D+o8|x+b7bvar marqueewidth=300y~ M*wlug [Bw
//高度t)p|)D-N
var marqueeheight=25
//速度(1-10)*J,~V%SK/O"oXh
var marqueespeed=3
//背景颜色
var marqueebgcolor="#FFFFFF"
//是否能暂停 (0=no. 1=yes)?
var pauseit=1
Wt_+K'V @
//修改显示内容
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
6k!u;yu$Q G1W
////下面不需改变////////////
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
var actualwidth=''
var cross_marquee, ns_marquee
function populate(){Uk|I1Uph:r&k
if (iedom){f5aA%tn4j*Tb4H9rw
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=marqueewidth+8i'w'jd1y&@-r1R
cross_marquee.innerHTML=marqueecontent.E$a#t2Z,zD
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
}kKZ5Y9T x]8l
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=marqueewidth+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close() UA+\w g.RK5[4H1]
actualwidth=ns_marquee.document.width9a3z%Y9{6HuCv1N
}rB!Af0|6zx
lefttime=setInterval("scrollmarquee()",20)d2a%q3c"j-[
}Tqg x%E mV5J;i
window.onload=populate
%pyRI1Hb:O}
function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))h:O5PP0z%g9cn4Lu}
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
elseI#kgy&CO9vdL#B
cross_marquee.style.left=marqueewidth+8Z0I:o%Q_'G
4pMF*Z9EM2V \/y
}
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed0b'{#]%jL `%J4L
else
ns_marquee.left=marqueewidth+8
}l[ gZY.hv*T^
}i_Bdqgr
if (iedom||document.layers){uq6C"ATX%?a
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')9fm7}-p8x~%|
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')g E$T/yg7K
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
write('</div>')a:r,jY2M3nS5Dq
};F6G'}+lNx
else if (document.layers){;YU3y4bo8L
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')4z+\&F#TC0fd!S
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')(A+t2A0?%eW _
}3bsg1y1}8~y
document.write('</td></table>') O%UF8UK%YF$O
}2CsJ0X_6bH+T1`2O
}!w~`7K V5{Z
</script>
页:
[1]