1 回答
TA贡献1829条经验 获得超7个赞
您可以使用loop:false这样它就不会产生重复的项目。
希望能帮到你
$('.with-loop').owlCarousel({
loop:true,
margin:10,
nav:true,
responsive:{
0:{
items:3
},
600:{
items:3
},
1000:{
items:5
}
}
})
$('.without-loop').owlCarousel({
loop:false,
margin:10,
nav:true,
responsive:{
0:{
items:3
},
600:{
items:3
},
1000:{
items:5
}
}
})
.with-loop {
margin-bottom: 30px;
}
.item {
height: 30px;
width: 40px;
background: red;
color: #fff;
text-align: center
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/owl.carousel.js"></script>
<link rel="stylesheet" href="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/assets/owl.carousel.min.css" />
<link rel="stylesheet" href="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/assets/owl.theme.default.min.css" />
<div class="owl-carousel owl-theme with-loop">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
</div>
<div class="owl-carousel owl-theme without-loop">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
</div>
添加回答
举报