title: How to change options based on number of items in the carousel using Owl Carousel 2?
body: <p>I'm using Owl Carousel 2 on a project with dynamic content with an unlimited amount of slides that can be added.</p>
  
  <p>So there could be an instance where there is only three slides or an instance where there is six.</p>
  
  <p>My desired functionality is that if there is less than four slides (the carousel shows four items at a time), then add the <code>mouseDrag: false</code> and <code>touchDrag: false</code> options.</p>
  
  <p>Here is my JS:</p>
  
  <pre><code>$('.owl-carousel').owlCarousel({
      loop:false,
      margin:20,
      responsive : {
          // breakpoint from 0 up
          0: {
              items: 1,
              mouseDrag:true,
              touchDrag:true
          },
          // breakpoint from 480 up
          500: {
              items: 2,
              mouseDrag:true,
              touchDrag:true
          },
          // breakpoint from 768 up
          740: {
              items: 3,
              mouseDrag:true,
              touchDrag:true
          },
          // breakpoint from 1024 up
          980: {
              items: 4,
              mouseDrag:false,
              touchDrag:false
          }
      }
  })
  </code></pre>
  
  <p>So, currently when the viewport is over 1024px wide, it will remove the dragging functionality regardless of how many items there are. Which means you can't see any more than 4 (if there are any).</p>
  
  <p>Thanks,
  Jay</p>