【问题标题】:Callback events not working - using Owl Carousel回调事件不起作用 - 使用 Owl Carousel
【发布时间】:2015-02-05 23:06:09
【问题描述】:

我正在尝试检测 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>&lt;</strong>", //this equates to "<"
                "<strong>&gt;</strong>" //this equates to ">"
            ] 
        });
        ;
    });

</script>

【问题讨论】:

    标签: javascript jquery owl-carousel-2


    【解决方案1】:

    initialize.owl.carouselinitialized.owl.carousel 事件必须在 Owl Carousel 初始化之前附加

    查看文档https://owlcarousel2.github.io/OwlCarousel2/docs/api-events.html的此链接

    【讨论】:

      【解决方案2】:

      【讨论】:

      • 请识别更改并通知提出问题的用户
      猜你喜欢
      • 1970-01-01
      • 2019-10-05
      • 2022-01-01
      • 1970-01-01
      • 2019-06-05
      • 2016-02-01
      • 2022-09-28
      • 2016-10-01
      • 2016-02-14
      相关资源
      最近更新 更多