当前位置: 移动技术网 > IT编程>开发语言>JavaScript > JQuery循环滚动图片代码查看

JQuery循环滚动图片代码查看

2018年07月15日  | 移动技术网IT编程  | 我要评论

代码如下:

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");
});
}
<p class="frame"><p 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="" /></p></p>
<button type="button"><<</button><button type="button" onclick="refresh()">>></button>
.box1
{
width:1200px;
overflow:hidden;
margin-left:-206px;
}
.frame
{
width:620px;
overflow:hidden;
}


图片宽度默认206px,没设定。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网