new Swiper('mySwiper', {
slidesPerView: "auto",
spaceBetween: 0,
freeMode: true,
preloadImages: true,
updateOnImagesReady: true,
preventClicksPropagation: true,
on: {
// 开始向后的偏移事件,官网api文档:https://www.swiper.com.cn/api/event/290.html
slideNextTransitionStart: function(e) {
// 我设置的加载阈值是500可随具体情况调节
if (e.virtualSize + e.translate - e.width < 500) {
// 加载更多
console.log("loadloadload");
}
},
},
});
Swiper轮播图自由模式滚动加载更多
于 2023-08-22 09:39:59 首次发布