window.timer = setInterval(function() {
$('.list-contanier')
.find('ul')
.animate(
{
marginTop: '-=1'
},
{
duration: 0,
easing: 'swing',
complete: function() {
var s = Math.abs(
parseInt($('.luckydraw-list').css('margin-top'))
);
if (s >= 51) {//li元素的高度
$('.luckydraw-list')
.find('li')
.slice(0, 1)
.appendTo($(this));
$('.luckydraw-list').css('margin-top', 0);
}
}
}
);
}, 5);
JS无限滚动效果的实现
最新推荐文章于 2023-09-22 11:22:39 发布