网络编程 
首页 > 网络编程 > 浏览文章

JQuery循环滚动图片代码

(编辑:jimmy 日期: 2025/9/24 浏览:3 次 )
复制代码 代码如下:
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="/UploadFiles/2021-04-02/001.png"><button type="button"><<</button><button type="button" onclick="refresh()"></button>
.box1
{
width:1200px;
overflow:hidden;
margin-left:-206px;
}
.frame
{
width:620px;
overflow:hidden;
}

图片宽度默认206px,没设定
上一篇:常见JS效果之图片减速度滚动实现代码
下一篇:Javascript类定义语法,私有成员、受保护成员、静态成员等介绍
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 网站地图 SiteMap