JAVASCRIPT不间断滚动(2)
发布时间:2021-06-06
发布时间:2021-06-06
JAVASCRIPT
///lanren/jscode/js-0063/images/01.jpg">
<img src="/lanren/jscode/js-0063/images/02.jpg">
<img src="/lanren/jscode/js-0063/images/03.jpg">
<img src="/lanren/jscode/js-0063/images/04.jpg">
<img src="/lanren/jscode/js-0063/images/05.jpg">
</div>
<div id=demo2></div>
</div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
demo.scrollTop=demo.scrollHeight
function Marquee(){
if(demo1.offsetTop-demo.scrollTop>=0)
demo.scrollTop+=demo2.offsetHeight
else{
demo.scrollTop--
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
看下这个,直接拷贝过来用就行了
向左滚动:/lanren/code/20070724/code153529.shtml
向右滚动:/lanren/code/20070724/code153817.s
html
向上滚动:/lanren/code/20070724/code152941.shtml
向下滚动:/lanren/code/20070724/code153045.shtml
上一篇:地震逃生知识