javascript - remove() doesn't work with draggable image -


i've .dropzone div inside #trash elements deleted .remove() drop in (with jquery ui .droppable , .draggable classes):

$('.dropzone').droppable({     tolerance: 'pointer',     accept: 'p',     drop: function(event, ui){         ui.draggable.remove();         $('#trashanim').animate({opacity: '1'}, 'fast')         $('#trashanim').animate({opacity: '0'}, 'slow');     } }); 

(#trashanim brief animation of trash bin triggered drop event).

works fine until try img: after drop event on .dropzone, image positions in left-top corner, loosing classes in road , getting attributes of position in tag (when test images, change accept parameter of ui class able recive 'img'). image not deleted parent.

i have implemented event-delegation showed in this post no results.

edit: when empty() parent node dragging element #trash image dessapear node. seems can deleted, when called element.

you said working img - assuming element dragging, it's tag <img>

with said, droppable set accept <p> tags.

try changing accept accept: 'p, img'