OWL 2 Carousel Auto Play not working
I have two slides. I used OWL 1 and it worked great. I want an infinite loop, so it moves to OWL 2.
The following code works fine. The slides remain in sync, but the autoplay never starts. I need to drag slides or show nav and click next / prev button.
Hoping that the answer is pretty obvious to someone with more experience.
$(document).ready(function() {
var carousel_1 = $('#the_carousel'),
carousel_2 = $('#the_carousel_content');
carousel_2.on('change.owl.carousel', function(event) {
carousel_1.trigger('to.owl.carousel', [event.item.index,100,true]);
});
carousel_1.owlCarousel({
items:1,
loop:true,
autoPlay: true,
autoplayTimeout: 100,
slideBy: 1,
autoplaySpeed: 100,
rewindNav: false
});
carousel_2.owlCarousel({
items:1,
loop:true,
autoPlay: false,
autoplaySpeed: 100,
autoplayTimeout: 100,
nav:false,
slideBy: 1,
rewindNav: false
});
});
</script>
Thank!
+3
source to share
2 answers
This guy had the same issue: Owl Carousel won't start
you need to manually add autoplay.js library from owl site
<script src="owl/js/owl.autoplay.js"></script>
0
source to share