复制代码 代码如下:
<div style="border:#d3d3d3 1px solid;width:100%;">
<div id="demo" style="overflow:hidden;height:160;width:100%;">
<div id="demo1">
文章标题列表
</div>
<div id="demo2"></div>
</div>
</div>
<script language="javascript">
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
<div style="border:#d3d3d3 1px solid;width:100%;">
<div id="demo" style="overflow:hidden;height:160;width:100%;">
<div id="demo1">
文章标题列表
</div>
<div id="demo2"></div>
</div>
</div>
<script language="javascript">
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
标签:
js,文字图片,上下滚动
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“javascript实现文字图片上下滚动的具体实例”评论...