Hi, thanks for great plugin!
I'm using Owl Carousel 2 with mousewheel.js. it's working fine, but when I set loop: false and I scroll to last or first item my mouse not working, how can I make mouse back to page scrolling when I go to first or last item ?
For example:
My mousewheel not working on my code.
$(document).ready(function() {
var owl = $("#quizcarousel");
owl.owlCarousel({
itemsCustom: [
[0, 1],
[450, 1],
[600, 2],
[700, 2],
[1000, 3],
[1200, 4],
[1400, 4],
[1600, 5]
],
navigation: true,
loop:true,
nav:true,
useMouseWheel: true,
navigationText: ["", ""],
pagination: false,
paginationNumbers: false
});
owl.on('mousewheel', '.owl-stage', function (e) {
if (e.deltaY>0) {
owl.trigger('next.owl');
} else {
owl.trigger('prev.owl');
}
e.preventDefault();
});
});
let owl = document.getElementsByClassName('owl-stage');
owl[0].addEventListener('mousewheel', e => {
if (e.deltaY > 0) {
$('.owl-carousel').trigger('next.owl', 0);
} else {
$('.owl-carousel').trigger('prev.owl', 0);
}
e.preventDefault();
}, false);
Most helpful comment
let owl = document.getElementsByClassName('owl-stage');