Answer the question
In order to leave comments, you need to log in
Setting up 2 swiper sliders?
Tell me about the swiper slide. I have 2 slides per page.
The first answer is to open a separate page block when scrolling
. The second is a simple slider (the same page block), but both have a mouse wheel event and when I use the second slider in the opposite direction, the first one also works, how can I fix this?
https://codepen.io/abdelyazy/pen/dyYJvNB
(scroll the wheel harder)
Answer the question
In order to leave comments, you need to log in
In this case, try to write the code for scrolling the wheel yourself using the swiper api. And there already check where your mouse is.
Somehow you can write this thing:
var swiper = new Swiper ('.pages');
$(window).on('mousewheel', function(e) {
if (e.originalEvent.wheelDelta / 120 > 0 && !pages.animating) {
swiper.slidePrev(pageChangeSpeed);
} else if (!pages.animating) {
swiper.slideNext(1300);
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question