swiperのサムネイルを1枚の時は表示させない

<div class="swiper-container gallery-top slider1"> <div class="swiper-wrapper"> <div class="swiper-slide"><img src="images/slide001.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide002.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide003.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide004.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide005.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide006.jpg" alt=""/></div> </div> <!-- Add Arrows --> <div class="swiper-button-next swiper-button-white"></div> <div class="swiper-button-prev swiper-button-white"></div> </div> <div class="swiper-container gallery-thumbs slider1"> <div class="swiper-wrapper"> <div class="swiper-slide"><img src="images/slide001.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide002.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide003.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide004.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide005.jpg" alt=""/></div> <div class="swiper-slide"><img src="images/slide006.jpg" alt=""/></div> </div> </div>
var galleryThumbs1 = new Swiper('.gallery-thumbs.slider1', { spaceBetween: 10, slidesPerView: 5, freeMode: true, watchSlidesVisibility: true, watchSlidesProgress: true, }); var galleryTop = new Swiper('.gallery-top.slider1', { spaceBetween: 10, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, thumbs: { swiper: galleryThumbs1 } });

wordressで写真を追加させる予定です。

現在上記の記述でサムネイルが表示され問題なく実装しています。
しかし、1枚のだけ投稿された場合にはサムネイルは部分(.gallery-thumbs)は表示させないようにしたいのですが、記述方法がわかりません。

ご教授願います。

コメントを投稿

0 コメント