我在使用autoplayTimeout在页面上平滑滚动时遇到了一些问题。它在加载前5个图像并滚动下一个图像后停止,它非常生涩。您可以看到示例here at the bottom of the page。
以下是我在javascript中的设置:
<script type="text/javascript">
$(document).ready(function() {
$("#owl-demo").owlCarousel({
autoplay: true,
items: 5,
autoplayHoverPause: true,
autoplayTimeout: 10,
autoplaySpeed: 1000,
fluidSpeed:true,
itemsDesktop : [1199,3],
itemsDesktopSmall: [979,3],
itemsMobile: [479,1],
navigation: false,
dots: false,
loop: true
});
});
</script>
我不确定我是否使用了正确的设置组合。
答案 0 :(得分:1)
jQuery('.owl-carousel').owlCarousel({
center: true,
items:3,
loop:true,
margin:30,
nav:false,
dots:true,
autoplay: true,
slideTransition: 'linear',
autoplayTimeout: 6000,
autoplaySpeed: 6000,
autoplayHoverPause: true,
responsive:{
0:{
items:1
},
600:{
items:3
},
1000:{
items:3
}
}
});
我正在为自己的轮播使用此代码,以使轮播平滑。注意:您必须将autoplayTimeout和autoplaySpeed值定义为相同,否则当第一张幻灯片来自最后一张幻灯片时,它将变得异常。
答案 1 :(得分:0)
使用smartSpeed属性:
$("#owl-demo").owlCarousel({ autoplay: true, smartSpeed: 2500 });