IDDRS/static/js/swip.js

56 lines
1.0 KiB
JavaScript
Raw Permalink Normal View History

2022-06-17 12:06:51 +00:00
var owl = $('.owl-carousel');
owl.owlCarousel({
loop: false,
center: false,
nav: false,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1200: {
items: 4
}
}
});
owl.on('mousewheel', '.owl-stage', function (e) {
if (e.deltaY > 0) {
owl.trigger('next.owl');
} else {
owl.trigger('prev.owl');
}
e.preventDefault();
});
// Go to the next item
$('.customNextBtn').click(function() {
owl.trigger('next.owl.carousel');
})
// Go to the previous item
$('.customPrevBtn').click(function() {
// With optional speed parameter
// Parameters has to be in square bracket '[]'
owl.trigger('prev.owl.carousel');
})
var owl_level = $('.owl-carousel-level');
owl_level.owlCarousel({
loop: false,
center: false,
nav: false,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1200: {
items: 6
}
}
});