Y
Y
Yana Egorova2022-04-21 19:18:23
JavaScript
Yana Egorova, 2022-04-21 19:18:23

Why does the swiper.js slider swipe when the slide is clicked?

I have a slider, inside each slide there is a button and a link, and when you click on the button, the slider flips to the next slide. If I understand correctly, this is related to the click event and its bubbling. There are two properties in the library's documentation that should prevent this paging. One is noSwipingClass (when adding the 'swiper-no-swiping' class to the button, it should stop scrolling), but it doesn't work for me, the second is noSwipingSelector (you need to add this key with the tag value to the slider initialization, in my case, the button) but also it doesn't fizzle. Am I doing something wrong? Someone faced this problem?

https://codepen.io/YanaE93/pen/xxpBypQ

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bingumd, 2022-04-21
@bingumd

use version 7 for now, since the problem is in 8 and has not yet been fixed - link 1 and link 2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question