我正在尝试检测 Owl Carousel 何时准备好进行操作,以便我可以向其中添加内容。下面的脚本启动轮播,但初始化的事件永远不会触发。
<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>