Hello, i’m using jquery draggable method to move an element to a new container. I want the original element to disappear once the dragging begins and have a clone of the original to be dragged instead. Then once is clone is dropped into droppable, I want the original to reappear in a third container and the clone to dissappear. I’m stuck at stage 1, (ie making the original to dissapar). Problem is, I don’t know how to select the object representing the original. Here’s what I’ve tried. I’ve also $(this).hide() in place of ui.draggable.hide(), but none of that works. Any ideas? Thanks.
[php]
function drag(){
$('#drag_box > img').draggable({//Elements to be dragged are image elements contained in #drag_box
helper: 'clone',
revert: true,
dragStart: function(event, ui){
ui.draggable.hide();//This line is supposed to hide the original
}
});//end draggable method
$('#drop_box').droppable({
accept: '#drag_box img',
drop: function(event, ui){
ui.helper.remove();//Removes the clone from the DOM
}
});//end droppable method
}//End drag
[/php]