又一图片向上滚动代码,支持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>