我有10张图片,请问我如何实现图片连续循环播放? 按一个键开始  按一个键可以结束

解决方案 »

  1.   

    <DIV id=demo  style="OVERFLOW: hidden; WIDTH: 980px; HEIGHT: 60px; valign: top">
    <TABLE cellSpacing=0 cellPadding=0 border=0>
    <TBODY>
    <TR>
    <TD id=demo1>
    <TABLE cellSpacing=0 cellPadding=0 border=0>
    <TBODY>
    <TR>
    <TD vAlign=top>
    <a href="" target=_blank><img src="D:\Documents and Settings\Administrator\My Documents\My Pictures\60.jpg" width=80 height=60 border=1 style="border-color=#eeeeee"></a>
    </TD>
    <TD vAlign=top>
    <a href="" target=_blank><img src="D:\Documents and Settings\Administrator\My Documents\My Pictures\8.jpg" width=80 height=60 border=1 style="border-color=#eeeeee"></a>
    </TD>
    <TD vAlign=top>
    <a href="" target=_blank><img src="D:\Documents and Settings\Administrator\My Documents\My Pictures\23.jpg" width=80 height=60 border=1 style="border-color=#eeeeee"></a>
    </TD>
    <TD vAlign=top>
    <a href="" target=_blank><img src="D:\Documents and Settings\Administrator\My Documents\My Pictures\60.jpg" width=80 height=60 border=1 style="border-color=#eeeeee"></a>
    </TD>
    <TD vAlign=top>
    <a href="" target=_blank><img src="D:\Documents and Settings\Administrator\My Documents\My Pictures\8.jpg" width=80 height=60 border=1 style="border-color=#eeeeee"></a>
    </TD>
    <TD vAlign=top>
    <a href="" target=_blank><img src="D:\Documents and Settings\Administrator\My Documents\My Pictures\23.jpg" width=80 height=60 border=1 style="border-color=#eeeeee"></a>
    </TD>
    <TD vAlign=top>
    <a href="" target=_blank><img src="D:\Documents and Settings\Administrator\My Documents\My Pictures\60.jpg" width=80 height=60 border=1 style="border-color=#eeeeee"></a>
    </TD>
    <TD vAlign=top>
    <a href="" target=_blank><img src="D:\Documents and Settings\Administrator\My Documents\My Pictures\8.jpg" width=80 height=60 border=1 style="border-color=#eeeeee"></a>
    </TD>
    <TD vAlign=top>
    <a href="" target=_blank><img src="D:\Documents and Settings\Administrator\My Documents\My Pictures\23.jpg" width=80 height=60 border=1 style="border-color=#eeeeee"></a>
    </TD>
    </TR></TBODY></TABLE></TD>
                                <TD id=demo2></TD></TR></TBODY></TABLE></DIV>
    <SCRIPT>var speed=10demo2.innerHTML=demo1.innerHTMLfunction Marquee(){if(demo2.offsetWidth-demo.scrollLeft<=0)demo.scrollLeft-=demo1.offsetWidthelse{  demo.scrollLeft++  } }var MyMar=setInterval(Marquee,speed)demo.onmouseover=function(){clearInterval(MyMar)}demo.onmouseout=function(){MyMar=setInterval(Marquee,speed)}</SCRIPT>