<script>
window.onload=function(){
var oDiv=document.getElementById('div1');
var oUl=oDiv.getElementsByTagName('ul')[0];
setInterval(function(){
oUl.style.left=oUl.offsetleft-2+'px'},50);
}
</script>
<style>
*{margin: 0;padding:0}
#div1{width:480px;height:120px; position:relative;background:green;margin:100px auto;}
#div1 ul{positon:absolute;left:0;top:0;}
#div1 ul li{width:120px;height:120px; list-style-type: none;float:left;}
</style>
<div id="div1">
<ul>
<li><img src="a.jpg" width=120px/>
</li>
<li><img src="a.jpg" width=120px/>
</li>
<li><img src="a.jpg" width=120px/>
</li>
<li><img src="a.jpg" width=120px/>
</li>
</ul>
</div>
写代码还是要认真一点,拼错了单词这种错误实在不应该出现