here is a simple question. I have a \'ul\' which i have made sortable via jquery-ui\'s sortable() function. I want to remove elements when they are dragged off the list.
I'm sure there are more than one correct way to do that but if i had to do it I would probably use a wrapper element as droppable. Why not main site container, the almighty #wrapper! Bind to drop
event of the droppable and remove the item completely. It won't stay in sortable either.
You could try to use a variable to check if the items you are dragging is dragged out of its parent container.
You can use the over and out events of the jQuery UI sortable to assign the value for this variable and then execute the removal of the dragged item on the beforeStop event.
here is a demo of what I have come up with: http://jsfiddle.net/drewP/m7VJq/1/
let me know if it works for you.