you can see my code right here: http://jsfiddle.net/Pghqv/6/
i have 3 black bars that can be dragged and dropped. they even snap to each other when they are close enough – that’s exactly what i want to have.
the last feature i want to add is that it’s not possible to stack to bars over each other. Kind of a hittest, whenever an element is dragged upon another one and the mouse is released it should snap to the outer edges of the bar underneath.
any idea how i can make that work?
thank you for your help!
I think you may have better results if you use “sortable”, along with a “grid”. See here: http://jqueryui.com/demos/sortable/#option-grid
Description: grid Default:false
Snaps the sorting element or helper to a grid, every x and y pixels. Array values: [x, y]
Try this:
http://jsfiddle.net/LN2rQ/