Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Owl carousel V1 disable/enable drag

Hey all I have a quick question regarding the Owl Carousel.

How can I enable the 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 the user uses on my page, I want to disable the ability to drag to the next slide. But if the user completes the options then I would like to enable it back so they can drag to the next slide.

How can this be done? I haven't been able to find a good example online for doing this.

like image 684
StealthRT Avatar asked Jan 20 '15 14:01

StealthRT


People also ask

How do you turn off drag in Owl carousel?

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

How do I customize my owl carousel?

Setting Up Owl Carousel 2 is easy; first place the jQuery, right after that, call the owl carousel JavaScript link. To provide the aesthetics also add the carousel CSS links. We are using the CDN links however you can download the owl carousel and call the scripts and CSS locally.

How do you increase dots in an owl carousel?

owl. carousel', [$(this). index(), 300]); }); That should be all you need to get custom dots up and going with Owl Carousel 2.


1 Answers

I found out how to do it finally:

 owl.data('owlCarousel').reinit({
     touchDrag  : true,
     mouseDrag  : true
 });
like image 186
StealthRT Avatar answered Oct 07 '22 00:10

StealthRT