0
我有一个画廊,有prev
& next scrolls
。点击jQuery移动列表项目
$(document).on('click', '.playlist-gallery > .prev', function() {
$('.playlist-item:first').appendTo(".playlist-gallery");
$('.playlist-item:last').hide().show();
});
$(document).on('click', '.playlist-gallery > .next', function() {
$(".playlist-item:last").prependTo(".playlist-gallery");
$(".playlist-item:first").hide().show();
});
这是为了删除第一个列表项,并发送到最后,或者反过来取决于所选的按钮。
我所看到的是当列表中只有两个项目时,上面的脚本只是保持重复。帮帮我?