首页 > 解决方案 > 如何让多个带有拇指的滑动器画廊在同一页面上工作

问题描述

  var galleryThumbs = new Swiper('.gallery-thumbs', {
  spaceBetween: 10,
  slidesPerView: 4,
  loop: true,
  freeMode: true,
  loopedSlides: 5, //looped slides should be the same
  watchSlidesVisibility: true,
  watchSlidesProgress: true,
});
var galleryTop = new Swiper('.gallery-top', {
  spaceBetween: 10,
  loop: true,
  loopedSlides: 5, //looped slides should be the same
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },
  thumbs: {
    swiper: galleryThumbs,
  },
});  

问题是当我想在一页中使用两个以上的 Swiper 拇指时,它们将无法正确链接(galleryThumbs,galleryTop),我想我知道问题出在这部分:

thumbs: {
swiper: galleryThumbs,
},

标签: javascriptjqueryswiper

解决方案


推荐阅读