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:

  1. after element dropped, original gets disabled automatically.

  2. 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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -