向左滚动图片

<table width="707" border="0" cellspacing="0" cellpadding="0" style="margin-top:12px;">
<tr>
 <td height="141" background="images/roll_product.jpg"><table width="677" align="center" height="111" border="0" cellpadding="0" cellspacing="0">
  <tr>
   <td><div id="demo" style="overflow:hidden;height:111;width:677;color:#ffffff"><table align="left" cellpadding="0" cellspace="0" border="0">
    <tr>
     <td id="demo1" valign="top"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
       <td><a href="#"><img src="200942895055.jpg" /></a></td>
       <td><a href="#"><img src="200942894855.jpg" /></a></td>
       <td><a href="#"><img src="2009427151652.jpg" /></a></td>
       <td><a href="#"><img src="2009427151603.jpg" /></a></td>
       <td><a href="#"><img src="2009427151420.jpg" /></a></td>
       <td><a href="#"><img src="2009427151302.jpg" /></a></td>
       <td><a href="#"><img src="2009427145617.jpg" /></a></td>
      </tr></table></td>
     <td id="demo2" valign="top">&nbsp;</td>
    </tr></table></div></td>
  </tr></table></td>
</tr>
</table>

<script language="javascript">
var speed=10//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>

posted @ 2009-04-28 11:19  独行客  阅读(182)  评论(0编辑  收藏  举报