var swiperV = new Swiper('.swiper-container-v', {
pagination: '.swiper-pagination-v',
paginationClickable: true,
direction: 'vertical',
allowSwipeToNext: false,
observer: true,
observeParents: true
});
var swiperH = new Swiper('.swiper-container-h', {
pagination: '.swiper-pagination-h',
paginationClickable: true,
direction: 'horizontal',
resistanceRatio: 0,
prevButton: '.swiper-button-prev',
nextButton: '.swiper-button-next',
a11y: true,
initialSlide: initSceneIndex,
onInit: function (swiper) { //Swiper2.x的初始化是onFirstInit
swiperAnimateCache(swiper); //隐藏动画元素
swiperAnimate(swiper); //初始化完成开始动画
},
onSlideChangeEnd: function (swiper) {
swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画
}
});
Drag & Drop abgeschlossen
swiperV.allowSwipeToNext=true;
So führen Sie eine Neuinitialisierung durch
正好最近也在使用 Swiper,但没有需要重新初始化的情况,看了一下文档:
更新配置应该是通过
params
属性吧:然后需要重新初始化: