Skip to content
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

Q. Implement snap to another element #138

Closed
xho opened this issue Jul 9, 2016 · 2 comments
Closed

Q. Implement snap to another element #138

xho opened this issue Jul 9, 2016 · 2 comments

Comments

@xho
Copy link

xho commented Jul 9, 2016

Hi, thank you for you library, this is just a question.

I use draggabilly to move several objects in a container and i would like to implement a snap to other elements' top/left coordinates.

I can easily calculate the absolute value of the distance (vertical or horizontal) between the dragged element and another element, but now I need a suggestion:
when this happens (ie the vert/horiz distance is less than a certain amount of pixels), how can I temporary suspend the drag vertically or horizontally (and keep the mouse pointer moving alone till the condition is not true anymore)? Do you think I should fork the library, or I can do it just using the existing methods and settings?
Thank you very much.
C_

[in case you're curious, I am developing a simple app to build football lineups, a beta is visible here]

@desandro
Copy link
Owner

desandro commented Jul 9, 2016

Thanks for this feature request. We already have an issue open for this one. See #91

@xho
Copy link
Author

xho commented Jul 9, 2016

Thank for your answer and sorry if I did not notice the existing issue (the word "container" in the title resulted misleading to me),
C_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants