<!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=utf-8" />
<title>向左无缝滚动</title>
<style type="text/css">
body,html,div,a{ margin:0 auto; padding:0}
#scroll_top {
background: #FFF;
overflow:hidden;
border: 1px dashed #CCC;
width: 98%;
}
#scroll_top img {
border: 3px solid #F2F2F2;
}
#scroll_main {
float: left;
width: 800%;
}
#scroll1 {
float: left;
}
#scrol2 {
float: left;
margin-left:7px;
}
</style>
<script type="text/javascript">
window.onload = function(){
var speed=50;var tab=document.getElementById("scroll_top");
var tab1=document.getElementById("scroll1");
var tab2=document.getElementById("scrol2");
tab2.innerHTML=tab1.innerHTML;
function Marquee(){
if(tab2.offsetWidth-tab.scrollLeft<=0)
tab.scrollLeft-=tab1.offsetWidth
else{
tab.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tab.onmouseover=function() {clearInterval(MyMar)};
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
}
</script>
</head>
<body> <div id="scroll_top">
<div id="scroll_main">
<div id="scroll1">
<img src="http://www.google.com/images/errors/robot.png" alt="404" />
<img src="http://www.google.com/images/errors/robot.png" alt="404" />
<img src="http://www.google.com/images/errors/robot.png" alt="404" />
<img src="http://www.google.com/images/errors/robot.png" alt="404" />
<img src="http://www.google.com/images/errors/robot.png" alt="404" />
<img src="http://www.google.com/images/errors/robot.png" alt="404" />
<img src="http://www.google.com/images/errors/robot.png" alt="404" />
</div>
<div id="scrol2" ></div>
</div>
</div>
</body>
</html>

  上面還有一篇是用jquery做的圖片無縫滾動。http://www.cnblogs.com/dying/p/3394529.html

最新文章

  1. gulp 安装 使用 和删除
  2. 解决driver.findElement(By)运行到此处报null指针问题
  3. vm centos 添加网卡 无配置文件
  4. iOS开发UI篇—实现UItableview控件数据刷新
  5. [转]动态调用webservice时 ServiceDescriptionImporter类在vs2010无法引用的解决方法
  6. ORACLE执行计划 explain说明
  7. 仿UC天气下拉和微信下拉眼睛头部淡入淡出--第三方开源--PullLayout
  8. UFLDL实验报告1: Softmax Regression
  9. 也许有用(也谈VC中ModifyStyle&amp;ModifyStyleEx无法改变控件的Style)
  10. AJAX跨域调用ASP.NET MVC或者WebAPI服务
  11. 关于日期条件查询的sql 代码
  12. javascript(3)
  13. wukong搜索引擎源码解读
  14. ReactJS React+Redux+Router+antDesign通用高效率开发模板,夜间模式为例
  15. Element表格嵌入复选框以及单选框
  16. 运用jieba库 寻找高频词
  17. 《Semantic Sentence Matching with Densely-connected Recurrent and Co-attentive Information》DRCN 句子匹配
  18. windows10如何打开vhd文件
  19. python 回溯法 子集树模板 系列 —— 12、选排问题
  20. commit your changes or stash them before you can merge

热门文章

  1. 【暑假】[实用数据结构]UVAlive 4329 Ping pong
  2. ubuntu 13.04下sublime text 3使用中文输入法
  3. Java SAX Parser
  4. iOS CAShapeLayer精讲
  5. UITableView性能优化
  6. css3种方法实现元素的绝对居中
  7. MAC 终端 显示隐藏文件 关闭显示隐藏文件
  8. 解决eclipse 使用run运行,始终会跳到debug模式!
  9. Xcode8 创建NSManageObject subclass方法
  10. Flume + HDFS + Hive日志收集系统