我在让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>
我不确定我是否使用了正确的设置组合。
发布于 2018-10-11 08:46:26
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
}
}
});
我将这个代码用于我自己的carousel,以使carousel平滑。注意:你必须定义autoplayTimeout和autoplaySpeed的值应该是相同的,否则当第一张幻灯片来自最后一张幻灯片时,它会跳动。
发布于 2017-12-08 11:12:36
使用smartSpeed属性的 :
$("#owl-demo").owlCarousel({ autoplay: true, smartSpeed: 2500 });
https://stackoverflow.com/questions/28312872
复制