javascript - If an item was not dragged to a specific location, then have it go to back to original position? -
i made quick drag , drop type menu. made drag item list trash div, , give alert saying "gone"
i want make can't drag item anywhere. has go trash or ".list4" it's called, or else send it's original position.
here jsfiddle: http://jsfiddle.net/gdze8/
here javascript:
$( init ) function init() { $(".contentitem").draggable(); $(".list4").droppable( { drop: handledropevent }); } function handledropevent ( event, ui ) { var draggable = ui.draggable; alert("gone") }
also, while i'm here, there way delete item once goes in "trash"?
Comments
Post a Comment