单行文字水平向右滚动js实现

<mce:script type="text/javascript"><!--  

var speed=30
var MyMar=setInterval(Marquee,speed)
demo2.innerHTML=demo1.innerHTML
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
function Marquee(){
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
// --></mce:script>

来源http://blog.csdn.net/fleplf/article/details/5634337

仅供参考,需要不少的修改

posted @ 2012-01-16 14:17  孤舟苦渡  阅读(2919)  评论(0编辑  收藏  举报