从右向左
<div id="demo" style="overflow:hidden;width:680px;color:#ffffff;">
<table cellpadding="0" cellspacing="0" border="0">
<tr><td id="demo1" valign="top" align="center">
<table cellpadding="2" cellspacing="0" border="0">
<tr align="center">
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
</tr>
</table>
</td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div>
<wbr><wbr> <script><br><wbr><wbr> var speed=1//速度数值越大速度越慢<br><wbr><wbr> demo2.innerHTML=demo1.innerHTML<br><wbr><wbr> function Marquee(){<br><wbr><wbr> if(demo2.offsetWidth-demo.scrollLeft<=0)<br><wbr><wbr> demo.scrollLeft-=demo1.offsetWidth<br><wbr><wbr> else{<br><wbr><wbr> demo.scrollLeft++<br><wbr><wbr> }<br><wbr><wbr> }<br><wbr><wbr> var MyMar=setInterval(Marquee,speed)<br><wbr><wbr> demo.οnmοuseοver=function() {clearInterval(MyMar)}<br><wbr><wbr> demo.οnmοuseοut=function() {MyMar=setInterval(Marquee,speed)}<br><wbr><wbr> </script></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
从左向右
<div id="demo" style="overflow:hidden;width:680px;color:#ffffff;">
<table cellpadding="0" cellspacing="0" border="0">
<tr><td id="demo1" valign="top" align="center">
<table cellpadding="2" cellspacing="0" border="0">
<tr align="center">
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
<td><a href="#" target=_blank><img src="images/sl_1.jpg" width="65" height="90" hspace="5" vspace="6" border="0" /></a></td>
</tr>
</table>
</td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div>
<wbr><wbr> <script></wbr></wbr>
<wbr><wbr> var speed=2//速度数值越大速度越慢<br><wbr><wbr> demo2.innerHTML=demo1.innerHTML<br><wbr><wbr> function Marquee(){<br><wbr><wbr> if(demo2.offsetWidth-demo.scrollLeft<=0)<br><wbr><wbr> demo.scrollLeft-=demo1.offsetWidth<br><wbr><wbr> else{<br><wbr><wbr> demo.scrollLeft++<br><wbr><wbr> }<br><wbr><wbr> }<br><wbr><wbr> var MyMar=setInterval(Marquee,speed)<br><wbr><wbr> demo.οnmοuseοver=function() {clearInterval(MyMar)}<br><wbr><wbr> demo.οnmοuseοut=function() {MyMar=setInterval(Marquee,speed)}<br><wbr><wbr> </script><br></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
我发现图片少了滚动一会就停止了,不知道什么原因,高手请指点!!