Owl carousel V1 disable / enable drag and drop

Hi everyone, I have a quick question regarding Owl Carousel .

How can I enable touchdrag when I first use this code:

var owl = $(".full-slider"); owl.owlCarousel({ slideSpeed : 500, singleItem : true, pagination : false, autoPlay : false, afterMove : slideChanged, startDragging : pauseOnDragging, touchDrag : false, mouseDrag : false }); 

Depending on the options that the user uses on my page, I want to disable the ability to drag and drop to the next slide. But if the user executes the parameters, I would like to turn it back on so that they can be dragged to the next slide.

How can I do that? I could not find a good example online for this.

+6
source share
1 answer

I learned how to do this finally:

  owl.data('owlCarousel').reinit({ touchDrag : true, mouseDrag : true }); 
+19
source

Source: https://habr.com/ru/post/981286/


All Articles