I am trying to detect when Owl Carousel is ready to be manipulated so that I can add content to it. The script below initiates the carousel but the initialized event never triggers.
<script type="text/javascript">
jQuery(document).ready(function () {
var owl = jQuery("#owl-example");
owl.on('initialized.owl.carousel', function(e) {
alert('hi');
}).owlCarousel({
navigation: true,
goToFirstSpeed: 2000,
singleItem: false,
transitionStyle: "fade",
items:<?=$_productCollection->getPageSize()?>,
lazyLoad: true,
autoWidth:true,
scrollPerPage:true,
mouseDrag:false,
touchDrag: false,
startPosition: "zero",
navigationText: [
"<strong><</strong>", //this equates to "<"
"<strong>></strong>" //this equates to ">"
]
});
;
});
</script>
initialize.owl.carousel and initialized.owl.carousel events must be attached before Owl Carousel initialization
Check this link of the documentation https://owlcarousel2.github.io/OwlCarousel2/docs/api-events.html