【问题标题】:angular 5 reInit owl carouselangular 5 reInit owl carousel
【发布时间】:2018-06-18 16:49:24
【问题描述】:

我可以在哪里运行函数 reInit() ngx-owl-carousel ?

我使用 ngx-owl-carousel 模块,并使用 angular 5,

如果路线改变猫头鹰-旋转木马被刹车

<owl-carousel  #OwlElement class="col-12 col-xs-6 top-15"
             [options]="{
                items: 1,
                autoplay: true,
                autoplayTimeout: 5000,
                loop: true,
                margin:0,
                mouseDrag: true,
                singleItem: true,
                nav:false,
                dotClass: 'dots',
                dotsClass: 'dots-record',
                dots: true,   
                smartSpeed:1000,
                navSpeed: 1000
              }"
             [items]="[record_img]"
             [carouselClasses]="['owl-theme', 'row', 'sliding']">

【问题讨论】:

    标签: angular owl-carousel


    【解决方案1】:

    在您的组件中:

    @ViewChild('OwlElement') OwlElement: OwlCarousel 
    
    yourMethod() {
        this.OwlElement.reInit();
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多