如何在网页中一部分内实现图片自动滚动
在网上看的都是一些单独的无缝滚动的代码,都是直接在一个网页上写在一个BODY内的,我现在不知道如何在网页一个小部分的div内实现图片滚动,求大牛指点一下啊,不胜感激。
现在我有的该部分的代码是这些:
<div id="right_content">
<h2>标题 <div class="read_more_link"> <a href="home.html">MORE</a> </div> </h2>
<div class="products_box">
<div id=demo style="overflow:hidden;width:480px;height:100px;border:2px solid #e0e0e0;padding:2px;" onMouseOver="stopscroll();" onMouseOut="doscroll()">
<div id="demo1" style="white-space:nowrap;padding:0;">
<a href="details.html"><img src="images/box_icon.gif" width="70" height="80" alt="pic" title="pic" class="gallery" /></a>
<a href="details.html"><img src="images/bullet.gif" width="70" height="80" alt="pic" title="pic" class="gallery" /></a>
<a href="details.html"><img src="images/clock.gif" width="70" height="80" alt="pic" title="pic" class="gallery" /></a>
<a href="details.html"><img src="images/clock.png" width="70" height="80" alt="pic" title="pic" class="gallery" /></a>
<a href="details.html"><img src="images/contact_icon.gif" width="70" height="80" alt="pic" title="pic" class="gallery" /></a>
</div>
</div>
</div>
</div>
<script>
var t=demo.scrollWidth
demo1.innerHTML+=demo1.innerHTML
function doMarquee()
{
demo.scrollLeft=demo.scrollLeft<demo.scrollWidth-demo.offsetWidth?demo.scrollLeft+1:t-demo.offsetWidth
}
function doscroll()
{
sc=setInterval(doMarquee,20)
}
function stopscroll()
{
clearInterval(sc)
}
doscroll()
</script>