I\'m currently using Owl Carousel to show a gallery on desktop/laptop sized devices. However on smaller devices I\'d like to disable the plugin and show each image stacked under
mcmimik's answer is correct, but I had to make one change for it to work for me.
In the function:
$(window).resize(function () {
if ($(window).width() < 641) {
if ($('.owl-carousel').hasClass('off')) {
var owlActive = owl.owlCarousel(owlOptions);
owl.removeClass('off');
}
} else {
if (!$('.owl-carousel').hasClass('off')) {
owl.addClass('off').trigger('destroy.owl.carousel');
owl.find('.owl-stage-outer').children(':eq(0)').unwrap();
}
}
});
Swap outowl.addClass('off').trigger('destroy.owl.carousel');
for owl.addClass('off').data("owlCarousel").destroy();
:
$(window).resize(function () {
if ($(window).width() < 641) {
if ($('.owl-carousel').hasClass('off')) {
var owlActive = owl.owlCarousel(owlOptions);
owl.removeClass('off');
}
} else {
if (!$('.owl-carousel').hasClass('off')) {
owl.addClass('off').data("owlCarousel").destroy();
owl.find('.owl-stage-outer').children(':eq(0)').unwrap();
}
}
});