我在产品页面上有2个Slider.js实例:
var swiperProdImage = new Swiper('.swiper-productimage', { }
var swiperThumbs = new Swiper('.swiper-productthumbs', { }
我想先控制下一个/上一个滑动的第二个,但不能使slideNext()正常工作?
我在哪里错了?
swiperProdImage.on('slideNextTransitionStart', function() {
swiperThumbs.slideNext();
swiperThumbs.update(true);
});
swiperProdImage.on('slidePrevTransitionStart', function() {
swiperThumbs.slidePrev();
swiperThumbs.update(true);
});
您可以使用它来同步滑块(在初始化滑块后立即执行:)
// Assign each other controls
swiperProdImage.controller.control = swiperThumbs;
swiperThumbs.controller.control = swiperProdImage;