How to change options based on number of items in the carousel using Owl Carousel 2?
问题 I'm using Owl Carousel 2 on a project with dynamic content with an unlimited amount of slides that can be added. So there could be an instance where there is only three slides or an instance where there is six. My desired functionality is that if there is less than four slides (the carousel shows four items at a time), then add the mouseDrag: false and touchDrag: false options. Here is my JS: $('.owl-carousel').owlCarousel({ loop:false, margin:20, responsive : { // breakpoint from 0 up 0: {