JQuery循环滚动图片代码
JQuery循环滚动图片代码
发布时间:2016-12-30 来源:查字典编辑
摘要:复制代码代码如下:functionrefresh(){vars=$(".box1");if(!s.is(":animated"))$(".b...

复制代码 代码如下:

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><div><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">>></button>

.box1

{

width:1200px;

overflow:hidden;

margin-left:-206px;

}

.frame

{

width:620px;

overflow:hidden;

}

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

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新Javascript教程学习
热门Javascript教程学习
编程开发子分类