又一图片向上滚动代码,支持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>
javascript图片向上滚动代码
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » javascript图片向上滚动代码
相关推荐
-      mootools实例:更改div的透明度动画效果
-      jquery获取当前类在第几个li上面
-      mootools应用:获取复选框中选中的值
-      使用javascript设置下拉框的默认值
-      一款漂亮的黑色风格JS焦点图,使用简单
-      javascript自动获取标题中的关键词
-      用jquery的siblings来实现tab选项卡功能
-      jquery框架操作checkbox控件