desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 386 forks source link

Q. Implement snap to another element #138

Closed xho closed 8 years ago

xho commented 8 years ago

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 commented 8 years ago

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

xho commented 8 years ago

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_