javascript - JQuery: dropped divs are sortable only after second click -
when drop divs sortable pane, can grab newly created divs after second time click on them. suppose refresh-related issue, cannot figure out how make work.
here jsfiddle: http://jsfiddle.net/dve5q/ , code:
$(".box").draggable({ helper: 'clone' }); $("#left").droppable({ accept: '.box.out', drop: function (e, ui) { $(this).append('<div class="box"></div>'); var droppedbox = $(this).children().last(); $(droppedbox).html(ui.helper.html()); } }); $("#left").sortable();
thanks help!
i use attribute connecttosortable: '#left'
demo http://jsfiddle.net/dve5q/1/
$(".box").draggable({ helper: 'clone', connecttosortable: '#left' }); $("#left").droppable({ accept: '.box.out', drop: function (e, ui) { } }); $("#left").sortable();
Comments
Post a Comment