<html><head><title></title>
<style>
#aa1{width:200px;height:50px;overflow:hidden;border:1px solid red;}
#aa2{width:600px;height:50px;background:red}
#aa2 div{width:100px;height:40px;margin:5px 0px 5px 0px;background:#fff;float:left}
</style>
<script language="javascript">
var abc=1
function aa(){
if(aa1.scrollLeft>=aa2.offsetWidth/2 && abc>0){aa1.scrollLeft=0}
if(aa1.scrollLeft==0 && abc<0){aa1.scrollLeft=aa2.offsetWidth/2}
aa1.scrollLeft+=abc;
setTimeout("aa()",50)
}
</script>
</head><body onload="aa()">
<div id="aa1">
<div id="aa2">
<div>1111111111111111</div>
<div>2222222222222222</div>
<div>3333333333333333</div>
<div>1111111111111111</div>
<div>2222222222222222</div>
</div>
</div>
<button onclick="javascript:abc=1"><<<<<<</button>
<button onclick="javascript:abc=-1">>>>>>></button>
</body></html>