各位大哥!求一段定时滚动的代码 假如页面中一行有五副图像1、2、3、4、5,希望每隔三秒,五副图像自动向前滚动,变成2、3、4、5、6,页面中还是有五副图像,这样的JS代码应该如何去写呢?希望各位大哥,帮帮菜鸟我! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!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> <title>Untitled Page</title> <style> img{ height:120px; width:110px; margin:0 5px;} </style></head><body> <div style="width: 600px; height: 120px; overflow: hidden" id="outer"> <div style="width: 1200px; height: 120px;" id="inner"> <div style="width: 600px; height: 120px; float:left;" id="imglist"> <img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" /> <img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" /> <img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" /> <img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" /> <img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" /> </div> </div> </div></body><script type="text/javascript">var outer = document.getElementById("outer");var inner = document.getElementById("inner");var imglist = document.getElementById("imglist");inner.appendChild(imglist.cloneNode(true));var timerfunction timeout(){ var count = 0; var interval; function move() { outer.scrollLeft += 5; count += 5; if(count>=120) window.clearInterval(interval); } interval = window.setInterval(move,10) if(outer.scrollLeft >= imglist.offsetWidth) outer.scrollLeft = 0;}timer = window.setInterval(timeout,3000)</script></html> jQuery UI 组件Tabs demo代码中的不解 Dreamweaver CS5 回车,大括号对齐的问题。 遇到一个解决不了的问题, 好心人帮帮忙. ExtJS的MessageBox的问题 如何使用javascript对网页中的flash进行控制 jquery clone出来的行,我怎么能在弹出页面上把值付给clone出来的行? 鼠标离开时候换另外一张图的js代码? 新手求教:在 text框里取得光标位置和设置光标在text框里的位置. 急,菜鸟求助!!!find()与sibling()有什么区别 为什么都清空了,还有一个呢 ext 表单提交添加问题? js或jquery读取json
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>
<style>
img{ height:120px; width:110px; margin:0 5px;}
</style>
</head>
<body>
<div style="width: 600px; height: 120px; overflow: hidden" id="outer">
<div style="width: 1200px; height: 120px;" id="inner">
<div style="width: 600px; height: 120px; float:left;" id="imglist">
<img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" />
<img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" />
<img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" />
<img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" />
<img src="http://avatar.profile.csdn.net/2/E/1/2_armstrong005.jpg" style="float:left" />
</div>
</div>
</div>
</body>
<script type="text/javascript">
var outer = document.getElementById("outer");
var inner = document.getElementById("inner");
var imglist = document.getElementById("imglist");
inner.appendChild(imglist.cloneNode(true));
var timer
function timeout()
{
var count = 0;
var interval;
function move()
{
outer.scrollLeft += 5;
count += 5;
if(count>=120) window.clearInterval(interval);
}
interval = window.setInterval(move,10)
if(outer.scrollLeft >= imglist.offsetWidth) outer.scrollLeft = 0;
}
timer = window.setInterval(timeout,3000)</script>
</html>