// Stop OWL Carousel if theres only one slide $owlContainers = jQuery(".owl-carousel"); $owlContainers.each(function () { $owlContainer = $(this); $owlSlides = $owlContainer.find('div.owl-item'); alert($owlSlides.length); // More than one slide - initialize the carousel if ($owlSlides.length <= 1) { $owlContainer.data('owlCarousel').stop(); } });
Schreibe einen Kommentar