Tyl*_*sSN 4 javascript jquery owl-carousel-2
我试图检测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>
Run Code Online (Sandbox Code Playgroud)
在Owl Carousel初始化之前必须附加initialize.owl.carousel和initialized.owl.carousel事件
查看文档的这个链接https://owlcarousel2.github.io/OwlCarousel2/docs/api-events.html
| 归档时间: |
|
| 查看次数: |
9661 次 |
| 最近记录: |