JS图片向上滚动效果

2019-03-08 network gramer 点击: 评论
<!DOCTYPE html PUBLIC "- W3C DTD XHTML 1 0 Transitional EN" "http: www w3 org TR xhtml1 DTD xhtml1-transitional dtd

天晟网络 小编在整理编程教程 > JavaScript > 看到JS图片向上滚动效果,下面是小编47为您找到的38051相关内容,希望47对您有帮助。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JS图片向上滚动效果 - 免费教程 www.timsion.com</title>
</head>

<body>
<div id="demo" style="overflow:hidden;height:500px;width:120px; border:1px solid #dde5bc; overflow:hidden;float:left">
  <div id=demo1> <img src="images/js01.gif" width="120" height="120"> <img src="images/js02.gif" width="120" height="120"> <img src="images/js03.gif" width="120" height="120"> <img src="images/js04.gif" width="120" height="120"> <img src="images/js05.gif" width="120" height="120"> <img src="images/js06.gif" width="120" height="120"> <img src="images/js07.gif" width="120" height="120"> <img src="images/js08.gif" width="120" height="120"> <img src="images/js09.gif" width="120" height="120"> </div>
  <div id=demo2></div>
</div>
<script>
var speed=40
var demo=document.getElementById("demo");
var demo2=document.getElementById("demo2");
var demo1=document.getElementById("demo1");
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>
</body>
</html>

转载文章请标明来自天晟网 Timsion.Com > 编程教程 > JavaScript >
标题:JS图片向上滚动效果
网址:http://www.timsion.com/javas/38051.html

关键词:向上滚动

上一篇:jquery.cookie 使用方法详解
下一篇:JS年月日三级下拉菜单

免责声明:以上内容来自互联网和用户投稿,不代表本站的观点和立场,版权归原作者所有,如有侵权,请与我们联系。