I am trying to understand the logic of how to do this.
I have a lot of images with just the CSS class name, they are created dynamically.
These images are dragged using jQuery UI .draggable.
I need to have a "recycle bin" that when an item is dragged, it is deleted.
Example : http://jsfiddle.net/KWdcU/3/ (Set to remove all items, not those that were dragged into it)
The code
<div class ="box">
<div class="stack">one</div>
<div class="stack">two</div>
</div>
<div id="trash">trash</div>β
$(function() {
$( ".stack" ).draggable();
});
$('#trash').droppable({
over: function() {
$('.box').remove();
}
});
source
share