基础写法
swiperOption: {
loop: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
type: 'custom',
renderCustom: function (swiper, current, total) {
return current + ' of ' + total;
}
}
},
本文介绍了如何使用Swiper插件配置选项`loop`和`pagination`来创建一个带有循环播放和自定义分页器的滑动展示。通过设置`pagination.renderCustom`函数,可以实现显示当前页数和总页数的功能,增强了用户体验。
基础写法
swiperOption: {
loop: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
type: 'custom',
renderCustom: function (swiper, current, total) {
return current + ' of ' + total;
}
}
},
3342
918
1612
1236
2448

被折叠的 条评论
为什么被折叠?