欢迎各位兄弟 发布技术文章
这里的技术是共享的
<div id="demo" style="overflow:hidden;width:550px;border:1px solid red;">
<table cellpadding="1" cellspacing="1">
<tr>
<td valign="top" id="marquePic1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td><img src="img.gif" width="70" height="70" border="0"></td>
<td><img src="img.gif" width="70" height="70" border="0"></td>
<td><img src="img.gif" width="70" height="70" border="0"></td>
<td><img src="img.gif" width="70" height="70" border="0"></td>
<td><img src="img.gif" width="70" height="70" border="0"></td>
<td><img src="img.gif" width="70" height="70" border="0"></td>
<td><img src="img.gif" width="70" height="70" border="0"></td>
<td><img src="img.gif" width="70" height="70" border="0"></td>
</tr>
</table>
</td>
<td id="marquePic2" valign="top"></td>
</tr>
</table>
</div>
<script language="javascript">
var speed=30;
marquePic2.innerHTML=marquePic1.innerHTML;
value = 0;
function Marquee(){
if(value >=marquePic1.scrollWidth){//demo向左滚动的距离,, 如果大于marquePic1的宽度
demo.scrollLeft=0;
value =0;
}else{
value = value+1;
demo.scrollLeft = value ;
}
}
var MyMar=setInterval(Marquee,speed);
demo.onmouseover=function() {clearInterval(MyMar);MyMar=null;}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>