Owl Carousel 2设置了自动播放延迟

时间:2016-10-07 19:20:06

标签: jquery owl-carousel

我在一个页面上有多个猫头鹰旋转木马(版本2),并且想要延迟其中一个的自动播放。这是我正在使用的代码。

owldelay.owlCarousel({
    loop: true,
    items: 1,
    autoplay:true,
    autoplayTimeout:2000,
    animateOut: 'fadeOut',
    mouseDrag: false,
    startPosition: 1,
    center: true
});

任何帮助将不胜感激。谢谢。

2 个答案:

答案 0 :(得分:0)

您已将每个轮播初始化为独立初始化

 $("#owl-1").owlCarousel({options});
 $("#owl-2").owlCarousel({options});

答案 1 :(得分:0)

在猫头鹰旋转木马2中,您可以触发stop.owl.autoplayplay.owl.autoplay个事件。 owl.carousel.js API events document

var $owl = $(element).owlCarousel(options);
var autoplayDelay = 2000;

if (autoplayDelay) {
   $owl.trigger('stop.owl.autoplay');
   setTimeout(function() {
    $owl.trigger('play.owl.autoplay');
   }, autoplayDelay);
}
相关问题