1

I'm working on owl carousel slider & I have to set max 5 items in a time. This is working fine when this is 5 items & more than 5 items but when there is less than 5 items then items repeating, how can I fixed it.

When there is less than 5 items then it should not be repeat.

My Code:-

$(function(){

$(".recent-visited-slider.owl-carousel").owlCarousel({
    dots: true,
    autoplay: true,
    loop: true,
    nav: true,
    items: 5,
  });
  
  });
<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">
<script src="https://owlcarousel2.github.io/OwlCarousel2/assets/vendors/jquery.min.js"></script>
<script src="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/owl.carousel.js"></script>

<div class="recent-visited-slider owl-carousel owl-theme">
<div class="item">item 1</div>
<div class="item">item 2</div>
<div>

ThankYou for your efforts!

Rohit Verma
  • 3,657
  • 7
  • 37
  • 75

0 Answers0