<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> *{ margin:0px; padding:0px} img{ float:left} #box{ width:500px; height:30px; overflow:hidden;} </style> </head> <body> <div id="box"> <table><tr> <td id="m1"> <table><tr><td> <img src="http://bbs.blueidea.com/images/default/logo.gif" border="0" /></td><td><img src="http://bbs.blueidea.com/images/default/logo.gif" border="0" /></td><td><img src="http://bbs.blueidea.com/images/default/logo.gif" border="0" /></td><td><img src="http://bbs.blueidea.com/images/default/logo.gif" border="0" /></td><td><img src="http://bbs.blueidea.com/images/default/logo.gif" border="0" /></td></tr></table> </td> <td id="m2"></td> </tr> </table> </div> <script language="javascript"> var s=10; function $(id){return document.getElementById(id);} $("m2").innerHTML=$("m1").innerHTML; function m(){ if($("box").scrollLeft>=$("m2").scrollWidth){ $("box").scrollLeft=0; }else{ $("box").scrollLeft++; } } var mm=setInterval(m,s); $("box").onmouseover=function(){ clearInterval(mm); } $("box").onmouseout=function(){ mm=setInterval(m,s); } </script> </body> </html>
提示:您可以先修改部分代码再运行