Swiper自定义分页,供大家参考,具体内容如下
最终实现效果图:
HTML DEMO(官网例子)
1.设置导航按钮
注:Sweiper 的导航按钮及其他一些DOM结构是可以放到“.swiper-container”之外的。
只需要按钮的class对应起来就OK。
var mySwiper = new Swiper ('.swiper-container', {
// 如果需要前进后退按钮
nextButton: '.button-next',//对应"下一题"按钮的class
prevButton: '.button-prev',//对应"上一题"按钮的class
pagination: '.pagination',//分页容器的css选择器
paginationType : 'custom',//自定义-分页器样式类型(前提)
//设置自定义分页器的内容
paginationCustomRender: function (swiper, current, total) {