欢迎光临
我们一直在努力

javascript图片向上滚动代码

建站超值云服务器,限时71元/月

又一图片向上滚动代码,支持IE和firfox浏览器。
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<div id=”demo” style=”OVERFLOW: hidden; WIDTH: 184px; HEIGHT: 300px”>
                          <div id=”demo1″>
                              <div style=”width:174px; height:100px; padding:5px; background-color:#e5bb7c; margin-bottom:10px;”><a href=”images/project_bjjt01a.jpg” target=”_blank”><img  src=”images/project_bjjt01.jpg” border=”0″/></a></div>
         <div style=”width:174px; height:100px; padding:5px; background-color:#e5bb7c; margin-bottom:10px;”><a href=”images/project_bjjt02a.jpg” target=”_blank”><img  src=”images/project_bjjt02.jpg” border=”0″/></a></div>
         <div style=”width:174px; height:100px; padding:5px; background-color:#e5bb7c; margin-bottom:10px;”><a href=”images/project_bjjt03a.jpg” target=”_blank”><img  src=”images/project_bjjt03.jpg” border=”0″/></a></div>
         <div style=”width:174px; height:100px; padding:5px; background-color:#e5bb7c; margin-bottom:10px;”><a href=”images/project_bjjt04a.jpg” target=”_blank”><img  src=”images/project_bjjt04.jpg” border=”0″/></a></div>
                           
                          
                          </div>
                          <div id=”demo2″></div>
                        </div>
         <script>
var speed=20
document.getElementById(“demo2”).innerHTML=document.getElementById(“demo1”).innerHTML
function Marquee(){
if(document.getElementById(“demo2”).offsetTop-document.getElementById(“demo”).scrollTop<=0)
document.getElementById(“demo”).scrollTop-=document.getElementById(“demo1”).offsetHeight
else{
document.getElementById(“demo”).scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
document.getElementById(“demo”).onmouseover=function() {clearInterval(MyMar)}
document.getElementById(“demo”).onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » javascript图片向上滚动代码
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址