不间断向左向右滚动代码无缝隙js


发布时间:2015/3/10 23:42:51

<!--向左开始-->
<div id=demo style="overflow:hidden;width:750px;" align=center>
<table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >
<tr><td valign=top bgcolor=ffffff id=marquePic1>
<table width='100%' border='0' cellspacing='0'><tr>
    <td align=center><a href='http://97235.com/'><img src="http://www.baidu.com/img/logo.gif" width=120 height=80 border=0><br><br>01</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>02</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>03</a></td>
    <td align=center><a href='http://97235.com/'><img src="http://www.baidu.com/img/logo.gif" width=120 height=80 border=0><br><br>04</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>05</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>06</a></td>
    <td align=center><a href='http://97235.com/'><img src="http://www.baidu.com/img/logo.gif" width=120 height=80 border=0><br><br>07</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>08</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>09</a></td>
    </tr></table>
</td><td id=marquePic2 valign=top></td></tr>
</table></div>
<script type="text/javascript">
var speed=50 
marquePic2.innerHTML=marquePic1.innerHTML 
function Marquee(){ 
if(demo.scrollLeft>=marquePic1.scrollWidth){ 
demo.scrollLeft=0 
}else{ 
demo.scrollLeft++ 
var MyMar=setInterval(Marquee,speed) 
demo.onmouseover=function() {clearInterval(MyMar)} 
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)} 
</script>
 
<!--向左结束-->
<!--向右开始-->
<div id="demo6" style="overflow:hidden;width:750px;" align=center>
<table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >
  <tr><td valign=top bgcolor=ffffff id=demo1>
<table width='100%' border='0' cellspacing='0'><tr>
    <td align=center><a href='http://97235.com/'><img src="http://www.baidu.com/img/logo.gif" width=120 height=80 border=0><br><br>01</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>02</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>03</a></td>
    <td align=center><a href='http://97235.com/'><img src="http://www.baidu.com/img/logo.gif" width=120 height=80 border=0><br><br>04</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>05</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>06</a></td>
    <td align=center><a href='http://97235.com/'><img src="http://www.baidu.com/img/logo.gif" width=120 height=80 border=0><br><br>07</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>08</a></td>
    <td align=center><a href='http://97235.com/'><img src=http://www.baidu.com/img/logo.gif width=120 height=80 border=0><br><br>09</a></td>
    </tr></table>
  </td><td id=demo7 valign=top></td>
  </tr>
</table>
</div>
  <script>
  var speeda=30
  demo7.innerHTML=demo1.innerHTML
 demo6.scrollLeft=demo6.scrollWidth
  function Marqueea(){
  if(demo6.scrollLeft<=0)
  demo6.scrollLeft+=demo7.offsetWidth
  else{
  demo6.scrollLeft--
  }
  }
  var MyMara=setInterval(Marqueea,speeda)
  demo6.onmouseover=function() {clearInterval(MyMara)}
  demo6.onmouseout=function() {MyMara=setInterval(Marqueea,speeda)}
  </script>
<!--向右结束-->
上一篇:2015年微商如何复制一款落地页成功赚钱
下一篇:“您未被授权查看该页,您不具备使用所提供的凭据查看该目录或 页的权限” -- 解决办法