-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constrain axis movement to x or y depending on direction #66
Comments
Thanks for the snippet! I added if (checkAxis && event.ctrlKey) and constraint is on when control key is pressed. Cheers! |
Hmmm.. The only problem now is that a user may move pointer by a pixel in the wrong direction and you get an opposite constraint in effect. For example, meaning to constrain along vertical axis, user moves mouse horizontally by a pixel, and then vertically by a greater distance. So, the movement will be constrained horizontally, which wasn't what user intended.... Any idea how that can be addressed? |
hmm.. whaaaaat !?
|
I don't think this is supported: axis: 'x, y' That's exactly the same as setting it to null. As for the interval check - would be nice to see how you implement it. Thanks. |
yep you have to (axis:'x, y') on "dragEnd" of course to be able to start a new measurement of user direction drag. |
I will have a go on the delay drag thing later this night or tomorrow, |
👍 Yeah, Mr. @desandro - would be nice to have it as a core functionality :) |
+ 1 |
@A-Monkey Thanks for taking a swing at this. I have put together another version http://codepen.io/desandro/pen/ogvVLw . Let's keep the discussion at #53 |
Kind of having a success though.. lol.
Maybe add setInterval to let user slip up the direction some.... ; )
The text was updated successfully, but these errors were encountered: