网页之跑马灯文字特效
//修改宽度var marqueewidth=300]f/^W y+qg jO
//高度
var marqueeheight=25egb/@2YSJ!\8[
//速度(1-10)
var marqueespeed=3
//背景颜色Jelbf
var marqueebgcolor="#FFFFFF"
//是否能暂停 (0=no. 1=yes)?
var pauseit=1
//修改显示内容P:k|3V[~HN
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'3]m)^8E:mdS
&j4a C_F7gAJ5M
////下面不需改变////////////
xX,xR So
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementByIda*g*X"PD_"h
if (iedom) CNc.vu&YZ`
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
var actualwidth=''
var cross_marquee, ns_marquee7b4J%W,\*u0Y/xt
function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=marqueewidth+8
cross_marquee.innerHTML=marqueecontent-AykKiMm3|;I
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
}k?4v"`{ME%Ej
else if (document.layers){m6? P/Kl6p)o
ns_marquee=document.ns_marquee.document.ns_marquee2]%v0k d,jVu
ns_marquee.left=marqueewidth+8
ns_marquee.document.write(marqueecontent)'q5zY?#iZ\8s
ns_marquee.document.close()@"Y[ c$I*CVj2xR
actualwidth=ns_marquee.document.width
}[b/k,~ Uo;j3m"U
lefttime=setInterval("scrollmarquee()",20);UGU0GT!Wk
}[6am!jV@)}c4]|
window.onload=populate;nZu \)z
P5~d.RR9i+^
function scrollmarquee(){~6ygp/I}|4@u)J
if (iedom){0S^Q!bJ$?
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
else@.gwq*K*Zcb
cross_marquee.style.left=marqueewidth+8NL brx-j1N\
4Ba%s O*~c
}
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))+a6T5C6yNS(| e
ns_marquee.left-=copyspeedO?-C6m5RcqJ1ts
else
ns_marquee.left=marqueewidth+8
}Sqf-kfgO
}
9D(B p] p Z"T,|s
if (iedom||document.layers){6Y3RD U y1x)[)n,sH
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){U)]O(H7n u6p `8a
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'),?(g]5iF]L4q
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')2DS;Uv.KW
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
write('</div>')
}
else if (document.layers){w$wt$UIku
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>')ICrj$v^*Q4z
write('</ilayer>')w$a'G&cZ,T-q.x
}&t3h$\(kGa
document.write('</td></table>')
}kJ\O~2L1Bk
}*cd Zt3c1u4q
</script>
页:
[1]