有中间向右滚动一次就停止

解决方案 »

  1.   

    啥意思 图片滚动吗? 肯定是js没写好了
         <div class="pro">
           <DIV id=demo style="OVERFLOW: hidden; margin-top:5px; width:430px; margin-left:10px;">
          <TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0">
            <TBODY>
            <TR>
              <TD id=demo1 vAlign=top><table border="0" cellpadding="0" cellspacing="0">
                <tr>
                   <td><div align="center" style="width:160px; margin:10px 0; text-align:center;"><a href="p_more.html"><img src="images/pro1.gif" width="150" height="146" alt="杭州缔依美科技有限公司" /></a>产品一&nbsp;</div></td>
                   <td><div align="center" style="width:160px; margin:10px 0;  text-align:center"><a href="p_more.html"><img src="images/pro1.gif" width="150" height="146" alt="杭州缔依美科技有限公司" /></a>产品一&nbsp;</div></td>
                   <td><div align="center" style="width:160px; margin:10px 0; text-align:center"><a href="p_more.html"><img src="images/pro1.gif" width="150" height="146" alt="杭州缔依美科技有限公司" /></a>产品一&nbsp;</div></td>
                   <td><div align="center" style="width:160px; margin:10px 0;  text-align:center"><a href="p_more.html"><img src="images/pro1.gif" width="150" height="146" alt="杭州缔依美科技有限公司" /></a>产品一&nbsp;</div></td>
                   <td><div align="center" style="width:160px; margin:10px 0; text-align:center"><a href="p_more.html"><img src="images/pro1.gif" width="150" height="146" alt="杭州缔依美科技有限公司" /></a>产品一&nbsp;</div></td>
                   <td><div align="center" style="width:160px; margin:10px 0; text-align:center"><a href="p_more.html"><img src="images/pro1.gif" width="150" height="146" alt="杭州缔依美科技有限公司" /></a>产品一&nbsp;</div></td>
                   <td><div align="center" style="width:160px; margin:10px 0; text-align:center"><a href="p_more.html"><img src="images/pro1.gif" width="150" height="146" alt="杭州缔依美科技有限公司" /></a>产品一&nbsp;</div></td>
                </tr>
              </table></TD>
              <TD id=demo2 vAlign=top>&nbsp;</TD>
              </TR></TABLE>
            </DIV>
    var speed3=25//速度数值越大速度越慢
    demo2.innerHTML=demo1.innerHTML
    function Marquee(){
    if(demo2.offsetWidth-demo.scrollLeft<=0)
    demo.scrollLeft-=demo1.offsetWidth
    else{
    demo.scrollLeft++
    }
    }
    var MyMar=setInterval(Marquee,speed3)
    demo.onmouseover=function() {clearInterval(MyMar)}
    demo.onmouseout=function() {MyMar=setInterval(Marquee,speed3)}