代码如下: Code 无标题文档 <br>.scroll_div { <br>width:660px; <br>height:146px; <br>margin:0 auto; <br>overflow: hidden; <br>white-space: nowrap; <br>background:#ffffff; <br>margin-left:-6px; <br>} <br>.scroll_div img { <br>width:128px; <br>height:140px; <br>border: 0; <br>margin: auto 2px; <br>border:3px #ccc solid; <br>} <br>#scroll_begin, #scroll_end, #scroll_begin ul, #scroll_end ul, #scroll_begin ul li, #scroll_end ul li { <br>display:inline; <br>}/*设置ul和li横排*/ <br> <br>function ScrollImgLeft(){ <br>var speed=5 <br>var scroll_begin = document.getElementById("scroll_begin"); <br>var scroll_end = document.getElementById("scroll_end"); <br>var scroll_div = document.getElementById("scroll_div"); <br>scroll_end.innerHTML=scroll_begin.innerHTML <br>function Marquee(){ <br> if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0) <br /> scroll_div.scrollLeft-=scroll_begin.offsetWidth <br /> else <br /> scroll_div.scrollLeft++ <br />} <br />var MyMar=setInterval(Marquee,speed) <br />scroll_div.onmouseover=function() {clearInterval(MyMar)} <br />scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)} <br />} <br /> /script> -// 左にスクロールしてコードを終了します--> <br> <br> <br> <br> <br></p>