
前提・実現したいこと
ここに質問の内容を詳しく書いてください。
swiperを利用して、自動再生されるスライダーを作成したのですが、
swiperのスライドをクリックすると、swiper自体が表示されなくなってしまいます。
swiperに対するクリックを無効にする方法はあるのでしょうか。
if
1 var swiper = new Swiper('.swiper-container.topview__swiper',{ 2 effect:'fade', 3 slidesPerView: 1, 4 autoplay: true, 5 loop: true, 6 speed: 5000, 7 mousewheelControl: false, 8 preventClicks: false, 9 preventClicksPropagation: false, 10 autoplayDisableOnInteraction: false 11 12 }); 13 var swiper = new Swiper('.swiper-container.photo-swiper',{ 14 slidesPerView: 3, 15 autoplay: true, 16 autoplaySpeed: 0, 17 speed: 250000, 18 loop: true, 19 mousewheelControl: false, 20 preventClicks: false, 21 preventClicksPropagation: false, 22 autoplayDisableOnInteraction: false 23 }); 24 function infinite() { 25 swiper.slideTo(swiper.slides.length); 26 swiper.once('transitionEnd', function(){ 27 swiper.slideTo(swiper.params.slidesPerView, 0, false); 28 setTimeout(function () { 29 infinite(); 30 }, 0); 31 }); 32 } 33 infinite(); 34}
どうぞ、よろしくお願いいたします。

swiperのverで参照ドキュメント、jsの記述の仕方が変わってきます。またswiperはCDNで指定なのか外部ファイル指定なのかビルドツールを使用してimportしているのかもっと細かく情報をください。cdn・外部ファイル・importでエラー内容や対処方法が変わってきます。swiper以前のところで問題が出ていてエラーになっている場合もあります。この質問の書き方だとマイナス評価を受けるおそれがあります。
問題が再現できるコードをご提示ください。簡単に試した限りでは、「swiper自体が非表示」という現象を再現できません。
質問の情報が不足していてすみません。
htmlの記述で、それぞれのスライドに対して、swiper-slideに加えてswiper-no-swipngクラスを追加することで問題解決できました。ご指摘、アドバイスありがとうございました。

回答3件
あなたの回答
tips
プレビュー