js图片滚动代码

精贴 置顶
1933 0

<div id=”demo” style=”overflow: hidden; width: 605px; height:100px;margin-left:7px”>
              <table height=100 cellspacing=1>
                <tbody>
                  <tr>
                    <td id=demo1 valign=top><img hspace=1 src=”images/1.jpg” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/2.jpg” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/1.jpg” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/1.jpg” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/1.jpg” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/1.jpg” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/1.jpg” border=0 width=”100″ height=”80″ /></td>
                    <td id=demo2 valign=top><img hspace=1 src=”images/1.jpg” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/3b0e743b-3fbe-47c0-88d3-4f43be483c72.gif” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/1.jpg” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/dnwx1.gif” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/1225950981_g.gif” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/1261703426-9896.gif” border=0 width=”100″ height=”80″ /><img hspace=1 src=”images/cty8kdhtlq_w.gif” border=0 width=”100″ height=”80″ /></td>
                  </tr>
                </tbody>
              </table>
              <script type=”text/javascript”>
var speed=30
document.getElementById(‘demo2′).innerHTML=document.getElementById(‘demo1′).innerHTML
function Marquee(){
if(document.getElementById(‘demo2′).offsetWidth-document.getElementById(‘demo’).scrollLeft<=0)
document.getElementById(‘demo’).scrollLeft-=document.getElementById(‘demo1′).offsetWidth
else{
document.getElementById(‘demo’).scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
document.getElementById(‘demo’).onmouseover=function() {clearInterval(MyMar)}
document.getElementById(‘demo’).onmouseout=function() {MyMar=setInterval(Marquee,speed)}
      </script>

  • 没有任何评论
今日天气 ···

···

···

···

热门排行
CSS cursor鼠标样式一览表 2012/6/25
.NET后台写JS代码 2011/11/3
网站地址多出jdfwkey的问题解析及... 2010/8/25
百度、google、Yahoo网站地图制作... 2011/1/30
数据库xxx的日志已满,请备份该数... 2013/7/19
<a>标签的伪类书写顺序问题... 2010/9/4
CEO名言 2010/8/31
什么是长尾关键词? 2010/9/24
Mysql 主从数据库同步 2010/9/12
用ASP实现网页BBS 2010/11/1
博主推荐
网站title标题如何正确修改不会被... 2013/8/26
ASP .NET MYSQL 的简单分页 并不... 2013/8/19
网站有弹窗广告这样的站点,百度... 2013/8/17
做淘宝SEO优化需要注意的8大问题 2013/8/17
淘宝网怎么做SEO优化 2013/8/17
站长们要学习的“苍井空精神” 2013/8/17
苹果公司今日发布了iOS 7第五个开... 2013/8/7
小米1刷V5系统WIFI不能连接解决办... 2013/8/1
本博客手机版上线咯!会员后台也... 2013/7/31
Win7系统环境安装配置PHP开发环境... 2013/7/29
随便看看
vs2008 包加载失败错误 2013/6/18
Java使用小技巧 字符串的反转输出... 2013/6/24
浮点型(实型)数据 2010/10/16
ASP文件中的安全问题 2010/10/23
如何使用标签阻止网页被收录? 2010/9/30
Asp.net常用的51个代码(非常实用... 2010/12/10
win7如何设置ip地址 2013/7/29
如何进行关键词分析? 2010/9/24
asp.net判断文件或文件夹是否存在... 2013/6/18
content = "IE=edge,chrome=1" 详... 2013/10/23
北京 上海 杭州 深圳 广州 成都