Z
Z
Zombie426792018-05-18 19:00:36
JavaScript
Zombie42679, 2018-05-18 19:00:36

Scrolling owl carousel with mouse wheel, crossbrowser?

There is such a piece of code, it makes the owl carousel scroll with the mouse wheel, but the problem is that in Google Chrome everything is fine, in FireFox it does not react at all, in IE it scrolls only forward, no matter where you turn the wheel, what could be the problem and how to solve it decide ?

shpOwl[0].addEventListener('mousewheel', function(e) {
if (e.deltaY > 0) {
   $('.shp-slider').trigger('prev.owl', [300]);
   } else {
   $('.shp-slider').trigger('next.owl', [300]);
   }
   e.preventDefault();
}, false);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dymok, 2018-05-18
@Zombie42679

Here is a demo from the documentation , works in Chrome, FF, IE11 for sure

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question