desandro / draggabilly

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

Feature Request: snap to container edge? #91

Open albell opened 9 years ago

albell commented 9 years ago

I'm trying to have an Adobe-style panel that snaps to the viewport edge. Basically, it's the containment option, but with an additional snapping behavior, with [x,y] proximity thresholds in pixels specified as you have now with grid. While I'm wishing, it would be useful if it fired an event (dock?), which could be used for later layout calcs. Thanks.

desandro commented 9 years ago

Thanks for this feature request. Add a 👍 reaction to this issue if you would see this feature added.

dominikwilkowski commented 8 years ago

:+1:

edu2004eu commented 8 years ago

While it's a nice feature, it's actually pretty easy to implement yourself. Managed to get this working with ~15 lines of code (on the X axis only; Y axis should be similar).

imjared commented 8 years ago

@edu2004eu Could you share those ~15 lines of code so people who have this issue can get some help?