jquery - Need help to re-enable dragging of a draggable -
i have draggable element
$(".element").draggable({ helper: "clone", revert: 'invalid', containment: '#parent', appendto: '#parent' });
i have 2 issues:
after element dropped, original gets disabled automatically.
a close anchor tag appended dropped element. on click of 'close' original element should again become draggable , should removed droppable 'div'.
i have written handler close anchor follows, removes element droppable doesn't make draggable aggain.
$('.cancel a',ui.helper).click(function() { $(ui.helper).remove(); $(ui.draggable).draggable('enable'); });
please help. in advance.
the answer first issue set disabled option of draggable element false.
$(".element").draggable({ helper: "clone", revert: 'invalid', disabled: false, containment: '#parent', appendto: '#parent' });
on handler close anchor, enable draggable object want drag. example,
$('.cancel a',ui.helper).click(function() { $(ui.helper).remove(); $('#element').draggable('enable'); });
Comments
Post a Comment