最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Owl carousel V1 disableenable drag - Stack Overflow

programmeradmin1浏览0评论

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.

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.

Share Improve this question edited Oct 23, 2017 at 4:55 VVV 7,5933 gold badges37 silver badges55 bronze badges asked Jan 20, 2015 at 14:47 StealthRTStealthRT 10.5k41 gold badges193 silver badges362 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 39

I found out how to do it finally:

 owl.data('owlCarousel').reinit({
     touchDrag  : true,
     mouseDrag  : true
 });
发布评论

评论列表(0)

  1. 暂无评论