Akash.syed
Akash.syed

Reputation: 31

owl-Carousel is not stopping vertical drag

This my Script

JS:

$('.owl-carousel').owlCarousel({
  loop:false,
  margin:10,
  responsiveClass:true,
  responsive:{
    0:{
           items:1
       },
       600:{
           items:2
       },
       960:{
           items:3
       },
       1200:{
           items:3
       }

  }
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

All I want to do is when user is sliding/dragging items to left or right vertical scroll is disabled and as soon as user stops drag it enables. I used onDrag and onDragged events but they work when the item is dragged not while dragging.

Upvotes: 2

Views: 1881

Answers (1)

Akash.syed
Akash.syed

Reputation: 31

ok I found my own answer. All you have to do is to add following to your css

.owl-carousel 
{
-ms-touch-action: pan-x;
touch-action: pan-x; 
}

Upvotes: 1

Related Questions