无缝滚动

 

从下到上:
<div id=demo style="overflow:hidden; width:128px; height:300px;">
<div id=demo1>
                <ul>
              
                <li>
图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
                <li>图片连续循环滚动代码(向上)</li>
              
                </ul>
</div>
<div id=demo2></div>
</div>
<script language="javascript">
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo. {clearInterval(MyMar)}
demo. {MyMar=setInterval(Marquee,speed)}
</script>
 
从右到左:
               <div id="demo" style="overflow: hidden; width: 605px; height:100px;margin-left:7px">
              <table height=100 cellspacing=1 class="roll_img">
                <tbody>
                  <tr>
                    <td id=demo1 valign=top><img hspace=1 src=\'#\'" /24999336.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /3b0e743b-3fbe-47c0-88d3-4f43be483c72.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /fdeb0f2e26a53dc08a139985.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /dnwx1.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /1225950981_g.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /1261703426-9896.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /cty8kdhtlq_w.gif" border=0 width="100" height="80" /></td>
                    <td id=demo2 valign=top><img hspace=1 src=\'#\'" /24999336.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /3b0e743b-3fbe-47c0-88d3-4f43be483c72.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /fdeb0f2e26a53dc08a139985.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /dnwx1.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /1225950981_g.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /1261703426-9896.gif" border=0 width="100" height="80" /><img hspace=1 src=\'#\'" /cty8kdhtlq_w.gif" border=0 width="100" height="80" /></td>
                  </tr>
                </tbody>
              </table>
               <script type="text/javascript">
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo. {clearInterval(MyMar)}
demo. {MyMar=setInterval(Marquee,speed)}
      </script>
</div>

你可能感兴趣的:(职场,滚动,休闲,无缝)