1.betterScroll
https://ustbhuangyi.github.io/better-scroll/#/examples/zh
2.Swiper
初始化实例:
var mySwiper = new Swiper ('.swiper-container', {
pagination: {
el: '.swiper-pagination',
},
})
常见问题:
1-1: 直接跳转到指定页
mySwiper .slideTo(0, 1000, false); //跳转到指定页(0表示第一页,速度是1000,false不调用回调函数 )
1-2: 当动态向swiper添加数据(或者从display:none变为block)时, 让其正确显示(要不滑动异常)
var mySwiper = new Swiper ('.swiper-container', {
pagination: {
el: '.swiper-pagination',
},
observer:true, //新添加
observerParent:true, //新添加
})