编程
您现在的位置:首页 >> 编程

横向无缝滚动图片代码

<BODY leftMargin=0 topMargin=2 marginheight="0" marginwidth="0">

<CENTER>

<TABLE style="BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid" cellSpacing=0 cellPadding=0 width=750 align=center border=0>

  <TBODY>

  <TR>

    <TD>

      <DIV id=demo style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff">

      <TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0">

        <TBODY>

        <TR>

          <TD id=demo1 vAlign=top><table width="1710" height="116"  border="0" cellpadding="0" cellspacing="0">

            <tr>

              <td width="171" background="tool/ExamplePic/example5.jpg" ><div align="center">5</div></td>

              <td width="171" background="tool/ExamplePic/example6.jpg" ><div align="center">6</div></td>

              <td width="171" background="tool/ExamplePic/example7.jpg" ><div align="center">7</div></td>

              <td width="171" background="tool/ExamplePic/example8.jpg" ><div align="center">8</div></td>

            </tr>

          </table></TD>

          <TD id=demo2 vAlign=top> </TD></TR></TBODY></TABLE></DIV>

<SCRIPT>

var speed3=25//速度数值越大速度越慢

demo2.innerHTML=demo1.innerHTML

function Marquee(){

if(demo2.offsetWidth-demo.scrollLeft<=0)

demo.scrollLeft-=demo1.offsetWidth

else{

demo.scrollLeft++

}

}

var MyMar=setInterval(Marquee,speed3)

demo.onmouseover=function() {clearInterval(MyMar)}

demo.onmouseout=function() {MyMar=setInterval(Marquee,speed3)}

</SCRIPT>

    </TD></TR></TBODY></TABLE>

</CENTER>

</BODY>