代码之家  ›  专栏  ›  技术社区  ›  Developer Tanbir

Owlcarousel版本2.3.4和自定义Owlcarousel addClassActive不工作

  •  0
  • Developer Tanbir  · 技术社区  · 7 年前

    我有个问题。我使用的是猫头鹰转盘v2.3.4,我已经创建了一个自定义猫头鹰圆点。自定义点正在工作,但

     
    
    

    var action = false, clicked = false;
        var Owl = {
            init: function() {
              Owl.carousel();
            },
            carousel: function() {
                var owl;
                $(document).ready(function() {
                    
                    owl = $('.testimonial_slider').owlCarousel({
                        items      : 1,
                        center     : true,
                        autoplay   : true,
                        nav        : false,
                        dots       : true,
                        addClassActive : true,
                        loop       : true,
                        margin     : 10,
                        dotsContainer : '.custom_owl_carousel',
                    });
    
                      $('.owl-next').on('click',function(){
                        action = 'next';
                      });
                      $('.owl-prev').on('click',function(){
                        action = 'prev';
                      });
    
                    $('.custom_owl_carousel').on('click', 'li', function(e) {
                        owl.trigger('to.owl.carousel', [$(this).index(), 300]);
                    });
                });
            }
        };
        Owl.init();

    1 回复  |  直到 7 年前
        1
  •  0
  •   Developer Tanbir    7 年前

    我得到了这个解决方案。我已经删除了这个

    $(document).ready(function() {