ASP无缝滚动代码
<!--向上滚动代码开始-->
<DIV id=rolllink style="OVERFLOW: hidden; WIDTH: 160px; HEIGHT: 100px">
<DIV id=rolllink1>
<TABLE cellSpacing=5 width="100%">
<tr>
<td id=demo11 vAlign=top>
滚动内容放在这里
</td>
<td id=demo12 vAlign=top></td>
</tr>
</TABLE>
</DIV>
<DIV id=rolllink2></DIV>
</DIV>
<SCRIPT>
var rollspeed=40
rolllink2.innerHTML=rolllink1.innerHTML
function Marquee(){
if(rolllink2.offsetTop-rolllink.scrollTop<=0)
rolllink.scrollTop-=rolllink1.offsetHeight
else{
rolllink.scrollTop++
}
}
var MyMar=setInterval(Marquee,rollspeed)
rolllink.onmouseover=function() {clearInterval(MyMar)}
rolllink.onmouseout=function() {MyMar=setInterval(Marquee,rollspeed)}
</SCRIPT>
<!--向上滚动代码结束-->
<!---向左滚动代码开始--->
<div id=demo style="OVERFLOW: hidden; WIDTH: 740px; COLOR: #ffffff; HEIGHT: 150px">
<TABLE height="140" border=0 align=center cellPadding=2 cellspacing="0" cellspace="0">
<TBODY>
<TR>
<TD width="515" vAlign=top id=demo1>
滚动内容放在这里
</TD>
<TD width="32" vAlign=top id=demo2></TD>
</TR>
</TBODY>
</TABLE>
</div>
<script>
var speed=25//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
<!---向左滚动代码结束--->