复制代码 代码如下: function refresh() { var s = $(".box1"); if (!s.is(":animated")) $(".box1").animate({ marginLeft: "0px" }, "slow", function () { $('.box1 img:first').before($('.box1 img:last')); $(".box1").css("margin-left", "-206px"); }); } <div class="frame"><div class="box1"><img src="img/001.png" alt="" /><img src="img/002.png" alt="" /><img src="img/003.png" alt="" /><img src="img/004.png" alt="" /></div></div> <button type="button"><<</button><button type="button" onclick="refresh()">>></button> .box1 { width:1200px; overflow:hidden; margin-left:-206px; } .frame { width:620px; overflow:hidden; } 图片宽度默认206px,没设定
推荐阅读
用nodejs访问ActiveX对象,以操作Access数据库为例。
起因 有人提问“如果用nodejs访问sql server?” 找了找资料,发现有两类解决方法,使用第三方nodejs插件:https://github.com/orenmazor/node-tds、使用ADODB.ConnectionActiveX对象。 参考: http://stackoverfl>>>详细阅读
本文标题:JQuery循环滚动图片代码
地址:http://www.17bianji.com/kaifa2/JS/23826.html
1/2 1