我有一个带有物品的猫头鹰传送带滑块,功能是
如果转盘中有5个以上的项目,则
使循环= true
autoplay = true
否则make loop = false。
自动播放=假
$(document).ready(function() {
$('#our_people_slider').owlCarousel({
loop:islooped,
nav:false,
autoplay:isautoplay,
stagePadding: 170,
margin:42,
items:1,
lazyLoad: true,
autoWidth:true,
autoHeight:false,
singleItem: true,
center:iscenter,
itemsScaleUp:true,
autoplayTimeout: 2000,
autoplaySpeed:2000,
responsive:{
1024:{
items:5,
}
},
})
var totalItems = $('.owl-item').length;
console.log(totalItems)
if (totalItems >= 4) {
var islooped = true;
var isautoplay = true;
var iscenter = true;
$('#our_people_slider').removeClass('slider-diable');
alert("true");
}
else {
var islooped = false;
var isautoplay = false;
var iscenter = false;
$('#our_people_slider').addClass('slider-diable');
alert("false");
}
});