views:

25

answers:

0

I have a draggable element

$(".element").draggable({
helper: "clone",
revert: 'invalid',
containment: '#parent',
appendTo: '#parent'
});

I have two issues : 1 --> After this element is dropped, the original gets disabled automatically. 2 --> A close anchor tag is appended to the dropped element. On click of this 'close' the original element should again become draggable and should be removed from the droppable 'div'. I have written a handler for the close anchor as follows, it removes the element from the droppable but it doesn't make it draggable aggain.

$('.cancel a',ui.helper).click(function()
{
$(ui.helper).remove();
$(ui.draggable).draggable('enable');
});

Please help. Thanks in advance.