Owlcarousel2: change owl carousel 2 options after setup?

Created on 18 Nov 2017  路  1Comment  路  Source: OwlCarousel2/OwlCarousel2

Hi, how to change options after init OwlCarousel2?

I write this code (base on https://stackoverflow.com/a/42301146) but It does not work properly.

var owl = $('.owl-carousel');
owl.owlCarousel({
    loop: true,
    rtl: true,
    autoplay: true,
    navText: ['<i class="fa fa-chevron-up"></i>', '<i class="fa fa-chevron-down"></i>'],
    items: 1,
    nav: true,
    dots: false,
    autoplayHoverPause: true,
    autoplayTimeout: 20000,
    animateOut: 'slideOutDown',
    animateIn: 'slideInDown'
});

function slide_change_animate(orientation) {
    var carousel = owl.data('owl.carousel');
    carousel.options.animateOut = 'slideOut'+orientation;
    carousel.options.animateIn = 'slideIn'+orientation;
    owl.trigger('refresh.owl.carousel');
}

slide_change_animate('Up');

>All comments

(Sorry about the canned reply.)
I'm sorry but this seems not be an "issue" related to the OwlCarousel project. Please go to a site like http://stackoverflow.com/ and get help by the community.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Uranbold picture Uranbold  路  3Comments

ghost picture ghost  路  3Comments

SimonHarte picture SimonHarte  路  3Comments

leighfarrell picture leighfarrell  路  3Comments

shamimsaj picture shamimsaj  路  3Comments