M
M
makcimusprime2018-11-09 02:16:26
JavaScript
makcimusprime, 2018-11-09 02:16:26

Why does scrolling with the mouse not work when using swiper slide and any other carousel in it?

There is a page (fullscreen) on which I use the swiper slide plugin. It has a block with horizontal scrolling (does not fit into 1 screen). To scroll it with the mouse, set the hover function

var mySwiper = new Swiper('.index_page', {
        speed: 400,
        direction: 'vertical',
        mousewheel: true,
        spaceBetween: 0,
        noSwipingClass: 'no-swipe',
    });

    $(".calendar__table").hover(function(){
        mySwiper.mousewheel.disable();
    }, function(){
        mySwiper.mousewheel.enable();
    });

everything is working!
the next screen should have a carousel.
But as soon as I connect any plugin (owl, slick or the same swiper) - the above function stops working.
What kind of conflicts can there be? And how can this problem be solved?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-11-09
@NeiroNx

Probably the plugin rewrites the handler or even changes the wrapper elements. You need to look in the developer console what the plugin does.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question