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
function owlInitialize() { if ($(window).width() < 1024) { $('#carousel').owlCarousel(); }else{ $('#carousel').owlCarousel('destroy'); } } $(document).ready(function(e) { owlInitialize(); }); $(window).resize(function() { owlInitialize(); });
Working Fiddle: https://jsfiddle.net/j6qk4pq8/187/