如何禁用循环:小屏幕尺寸为true



我发现猫头鹰旋转木马在iphone上滑动图像时会崩溃,设置为loop: off修复了这个问题。

你能帮我这个js -我需要添加/更改什么,使loop: off适用于屏幕尺寸<768px和loop: true的所有其他?

$(document).ready(function() {
$('.my-carousel').owlCarousel({
items: 1, 
loop: true, 
center:true, 
margin:10, 
URLhashListener:true,
autoplayHoverPause:true,
startPosition: 'URLHash',
autoplayHoverPause: false,
items: 1, 
navText : ["<p><small>Prev</small> and <small>Next</small></p>"],
responsive:{
0:{
items:1
},
600:{
items:1
},
1000:{
items:1
}
}   
});
})`

您是否尝试过在响应上设置循环false ?

如果你想设置特定的宽度,也可以在响应行为中使用宽度,然后在响应行为中使用0,600,1000更像@media only screen and (min-width : ...):

$(document).ready(function() {
$('.my-carousel').owlCarousel({
items: 1, 
//loop: true, 
center:true, 
margin:10, 
URLhashListener:true,
autoplayHoverPause:true,
startPosition: 'URLHash',
autoplayHoverPause: false,
items: 1, 
navText : ["<p><small>Prev</small> and <small>Next</small></p>"],
responsive:{
0:{
items:1,
loop: false
},
768:{
items:1,
loop: false
},
1000:{
items:1,
loop: true
}
}   
});
})`

相关内容