Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Owl carousel sensitive drag causes slide changing while scrolling

I'm working on a web application which is using owl carousel 2. My problem is that while I'm scrolling vertically over a slide, let's say slide2 this causes the change of the slide to slide 3 or slide 1. My carousel dragging is too sensitive causing me unnecessary slide changes.

Thanks in advance please help if you can I will really appreciate it.

Here are my owl carousel options

          // carousel setup
          $(".owl-carousel").owlCarousel
          ({
            responsive: true,
            lazyLoad:true,
            scrollPerPage:true,
            navigation : false,
            pagination: false, //remove pagination 
            slideSpeed : 200,    //default 200
            paginationSpeed : 400, //default 400
            singleItem: true,
            autoHeight: true,
            afterMove: top_align,
            afterMove: function(){ $(window).scrollTop(0);
             var owl = $("#viewport").data('owlCarousel');
             $(".tabBtn").removeClass("ui-btn-active").eq(owl.currentItem).addClass("ui-btn-active");
             }    
          });
            function top_align() {
            $(window).scrollTop(0);
            console.log('move');
            }
like image 471
Antreas Apostolou Avatar asked Mar 16 '15 01:03

Antreas Apostolou


1 Answers

I've had a quick look through the source code and it seems like you don't have the option to adjust the touchDrag sensitivity. You can disable it, however:

$('.own-carousel').ownCarousel({
    touchDrag: false
});
like image 91
Jamy Avatar answered Oct 01 '22 06:10

Jamy