I have a div and after dropping it at a new location, this action will be triggered:
function handleActionDrop(event, ui) {
// can not be dragged
开发者_开发百科 ui.draggable.draggable('disable');
// only one is allowed to be dropped
$(this).droppable('disable');
// set to the new position
ui.draggable.position({ of: $(this), my: 'left top', at: 'left top' });
// disable the revert of the selected div
ui.draggable.draggable('option', 'revert', false);
}
After I double click on that div, the div will be moved back to the initial position (done). However, if I set that div to have the same behavior that it can be dragged, then it does not work. I tried to do it like this: $(theDiv).draggable()
;
Is there any way to reset the div to have the same behavior as the starting state? or is there a way to reactivate the disabled draggable div?
Thanks in advance.
精彩评论