Specifically, I'm using draggables/droppables, and when dropped, I would like to move the draggable (it's children, events, etc) from belonging to its parent element to be appended/added as a child of the drop target.
I know that in the droppable drop
option, I can supply the following callback:
function(event, ui) {
// stuff
}
where $(this).target
will be the drop target, and ui.draggable
will be the child element I would like to move - but I'm not sure the proper way to actually perform the move, preserving events, etc.
append()
will remove the element and place it where you want.
$(this).target.append(ui.draggable);
// or, if $(this).target is not a jQuery object
var target = $(this).target;
$(target).append(ui.draggable);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With