Jump to content
Search Community

Draggable slider force only x-axis drag

Dennyno test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

Hi, I customised  this demo, but I've seen that on mobile, slides start sliding also while vertical scrolling.

It's the last library version, how to lock and force the carousel only for the real x-axis scroll (and maybe adding a little resistance//long swipe)?

It's not natural to see the content shake while scrolling down the page, only if the user truly horizontally swipe it's a needed feature...

Cheers

See the Pen QWajmBg by DedaloD (@DedaloD) on CodePen

Link to comment
Share on other sites

  • Dennyno changed the title to Draggable slider force only x-axis drag
  • Solution

Well, you have 2 touch actions going on there, swiping and scrolling, so unless you move your finger perfectly up and down in a straight line, it might trigger the slider swipe. You can probably increase the minimumMovement on the Draggable so it's not so sensitive.

 

Quote

Number - By default, Draggable requires that the Draggable element moves more than 2 pixels in order to be interpreted as a drag, but you can change that threshold using minimumMovement. So minimumMovement: 6 would require that the Draggable element moves more than 6 pixels to be interpreted as a drag.

 

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...