javascript 连续滚动

<div id="link" style="OVERFLOW: hidden; HEIGHT: 30">

<div id="link1">
<a href="http://www.163.com" target="_blank">网易</a><br>
<a href="http://www.163.com" target="_blank">网易</a><br>
<a href="http://www.163.com" target="_blank">网易</a><br>
<a href="http://www.163.com" target="_blank">网易</a><br>
<a href="http://www.163.com" target="_blank">网易</a><br>
<a href="http://www.163.com" target="_blank">网易</a><br>
<a href="http://www.163.com" target="_blank">网易</a><br>
<a href="http://www.163.com" target="_blank">网易</a><br>
<a href="http://www.163.com" target="_blank">网易</a><br>
<a href="http://www.163.com" target="_blank">网易</a><br>
</div>

<div id="link2"></div>

</div>

<script>
var speed=60;
link2.innerHTML=link1.innerHTML;
function Marquee(){
if(link2.offsetTop-link.scrollTop<=0)
link.scrollTop-=link1.offsetHeight;
else{
link.scrollTop++;
}
}
var MyMar=setInterval(Marquee,speed);
link.onmouseover=function() {clearInterval(MyMar)}
link.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>

posted @ 2007-08-04 04:42  ZetaChow晓代码  阅读(109)  评论(0编辑  收藏  举报