Angular 5 Owl Carousel如何提高/降低旋转速度

时间:2018-11-29 07:12:11

标签: angular owl-carousel

我在Angular5中使用Owl Carousel,但想提高或降低滑动速度,但是我找不到任何选择。

在module.ts文件中,

import { OwlModule } from 'ngx-owl-carousel';

@NgModule({
    imports: [
        OwlModule],
    exports: [OwlModule],

在.html文件中:

<owl-carousel [options]="{items: 1, dots: false, loop:true, autoplay:true, nav: true, responsive: { '0': { nav: false, dots: true}, '1200': { nav: true, dots: false}}}"
         [items]="bannerImages" [carouselClasses]="['owl-theme', 'row', 'sliding']">
            <div class="item" *ngFor="let image of bannerImages">
                <!-- <div class="image" [ngStyle]="{'background-image': 'url('+image.imagePath+')'}"></div> -->
                <div class="image">
                    <img [src]="image.imagePath">
                    <!-- caption start -->
                    <div class="container caption h-100 d-flex">
                        <div class="row align-items-center">
                            <div class="col caption-content" [innerHTML]="image.bannerContent"></div>
                        </div>
                    </div>
                    <!-- caption end -->
                </div>
            </div>
        </owl-carousel>

我仔细阅读了文档https://www.npmjs.com/package/ngx-owl-carousel,发现有一个选项next。但是我该如何实现呢?我的目的是增加/降低滑动速度。

1 个答案:

答案 0 :(得分:1)

我认为您应该检查本地猫头鹰轮播选项 https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html

并提供navSpeed。像这样

<owl-carousel [options]="{items: 1, ..., navSpeed: 200}"
...