使用JS实现图片无限循环左右滚动
来源:互联网 发布:淘宝导航栏的尺寸 编辑:程序博客网 时间:2024/06/05 18:49
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JS实现图片滚动</title>
<style>
#photo {
height: 120px;
width: 700px;
margin-top: 100px;
margin-right: auto;
margin-left: auto;
border: 2px double #FF0000;
overflow: hidden;
}
#photo img {
height: 110px;
width: 160px;
}
</style>
</head>
<body>
<div id=photo>
<table align="center">
<tr>
<td width=700 height=120 align=center >
<div id=demo style="overflow:hidden;width:700px;height:120px" align=center>
<table border=0 align=center cellpadding=0 cellspacing=0 cellspace=0 >
<tr>
<td valign=top id=marquePic1>
<table cellspacing="5" cellpadding="0">
<tr>
<td width=170 height=110 align="center"><img src="pic/fj1.gif" /></td>
<td width=170 height=110 align="center"><img src="pic/fj2.gif" /></td>
<td width=170 height=110 align="center"><img src="pic/fj3.gif" /></td>
<td width=170 height=110 align="center"><img src="pic/fj4.gif" /></td>
<td width=170 height=110 align="center"><img src="pic/fj5.gif" /></td>
<td width=170 height=110 align="center"><img src="pic/fj6.gif" /></td>
</tr>
</table>
</td>
<td id=marquePic2 valign=top></td>
</tr>
</table>
</div>
</td></tr></table>
<SCRIPT type=text/javascript>
var speed=10
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>
</body>
</html>
我在本地测试好了才放来的。图片之间的距离,整体的高度、长度请根据自己的需求来更改!
转:http://hi.baidu.com/%B7%E3%D2%B6%B2%D7%C0%CB/blog/item/3ded0fcec586c635f9dc6178.html
- 使用JS实现图片无限循环左右滚动
- js实现图片左右循环滚动
- NGUI实现图片左右无限滚动
- js图片左右滚动
- 滚动视图(UIScrollView)无限无缝左右切换图片,自动顺序加逆序循环播放图片
- 左右循环图片滚动代码
- js实现左右滚动
- Jquery实现图片左右滚动,没有头尾的,一直循环
- 使用ViewPager实现左右循环滑动图片
- 使用ViewPager实现左右循环滑动图片
- 使用UIScrollView实现图片无限循环浏览
- Js图片连续左右滚动
- js图片左右无缝滚动
- ViewPager实现左右无限循环效果
- android viewpager 实现左右无限循环
- ViewPager实现左右无限循环滑动
- ViewPager实现左右无限循环效果
- JS图片循环滚动
- 如何在写文件时转换unicode汉字避免乱码
- 在TOMCAT中使用JDOM和JAXEN
- 例4-1......例4-2 鼠标在窗口中画矩形
- Fckeditor增加自定义工具栏(ToolbarSet)及FCKeditor对象在页面的使用
- 恢复“快速启动”
- 使用JS实现图片无限循环左右滚动
- Linux学习小日志
- 非常 有感觉 24l01 模块 一次成功!!!使用 stc12 系列 的 单片机
- Mysql中如何设置日期字段默认值为当前日期
- 开心
- 开心
- UDP协议下内网与公网IP进行发送消息
- 委托
- asp.net的尖括号绑定字段总结