问题:不想使用swiper(用的是4.5.1版本)的自带的圆钮式的分页器,需要自定义样式同时分页器需要摆在图片外面
解决办法:利用swiper提供的renderCustom()方法
html文件
js文件
var mySwiper = new Swiper ('.swiper-container', {
autoplay: {
delay: 3000,
disableOnInteraction: false
},
pagination: {
el: '.swiper-pagination',
type: 'custom',
renderCustom: function (swiper, current, total) {
var customPaginationHtml = "";
for(var i = 0; i < total; i++) {
// 判断哪个分页器此刻应该被激活
if(i == (current - 1)) {
cust