活动 to.owl.carousel 和项目 > 1
Event to.owl.carousel and items > 1
为什么事件 to.owl.carousel
在 items
> 1 时无法正常工作?当我尝试切换到幻灯片 1 时,它会连续滚动 2 张幻灯片。
在这个问题之后,他们解决了 to.owl.carousel
将采用 3 个参数 [position, speed, offset]
。
https://github.com/OwlCarousel2/OwlCarousel2/issues/421
请尝试以下代码:
$('.button').on('click', function() {
$('.owl-carousel').trigger('to.owl.carousel', [$('input').val(), 100, 1]);
});
为什么事件 to.owl.carousel
在 items
> 1 时无法正常工作?当我尝试切换到幻灯片 1 时,它会连续滚动 2 张幻灯片。
在这个问题之后,他们解决了 to.owl.carousel
将采用 3 个参数 [position, speed, offset]
。
https://github.com/OwlCarousel2/OwlCarousel2/issues/421
请尝试以下代码:
$('.button').on('click', function() {
$('.owl-carousel').trigger('to.owl.carousel', [$('input').val(), 100, 1]);
});