当前位置:首页 > 程序&理念 >

横向无缝滚动的JS代码

时间:2007-06-17 09:46:33浏览:32583 转载

<div id=demo style=overflow:hidden;height:146;width:750;color:#ffffff>
<table align=left cellpadding=0 cellspace=0 border=0>
 <tr>
    <td id=demo1 valign=top>
     <a href="DM.asp"><img src="images/DM_01.gif" WIDTH="108" HEIGHT="146" border=0></a>&nbsp;
     <a href="DM.asp"><img src="images/DM_02.gif" WIDTH="108" HEIGHT="146" border=0></a>&nbsp;
     <a href="DM.asp"><img src="images/DM_03.gif" WIDTH="108" HEIGHT="146" border=0></a>&nbsp;
     <a href="DM.asp"><img src="images/DM_04.gif" WIDTH="108" HEIGHT="146" border=0></a>&nbsp;
     <a href="DM.asp"><img src="images/DM_05.gif" WIDTH="108" HEIGHT="146" border=0></a>&nbsp;
     <a href="DM.asp"><img src="images/DM_06.gif" WIDTH="108" HEIGHT="146" border=0></a>&nbsp;
     <a href="DM.asp"><img src="images/DM_07.gif" WIDTH="108" HEIGHT="146" border=0></a>&nbsp;
    </td>
<td id=demo2 valign=top></td>
<td id=demo3 valign=top></td>
<td id=demo4 valign=top></td>
<td id=demo5 valign=top></td>
<td id=demo6 valign=top></td>
</tr>
</table>
</div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML;
demo3.innerHTML=demo1.innerHTML;
demo4.innerHTML=demo1.innerHTML;
demo5.innerHTML=demo1.innerHTML;
demo6.innerHTML=demo1.innerHTML ;
function Marquee(){
    if(demo6.offsetWidth-demo.scrollLeft<=0)
        demo.scrollLeft-=demo1.offsetWidth
    else{
        demo.scrollLeft++
    }
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>

上一篇:股歌《死了都不卖》红遍网络[在线下载]
下一篇:本地分类信息网站线下推广招数

发表评论

昵称:  验证码:

关于博主

博主

博主:BlueCode

职业:web程序

简介:2002年开始一直从事Web制作,网站运营,会PHP+MYSQL ASP+MSSQL,微信开发