Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
重新激活禁用的可拖动div jquery_Jquery_Jquery Ui - Fatal编程技术网

重新激活禁用的可拖动div jquery

重新激活禁用的可拖动div jquery,jquery,jquery-ui,Jquery,Jquery Ui,我有一个div,将其放到新位置后,将触发此操作: 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 u

我有一个div,将其放到新位置后,将触发此操作:

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);
}
在我双击该div之后,该div将被移回初始位置done。但是,如果我将该div设置为具有与可以拖动它相同的行为,那么它将不起作用。我试着这样做:$theDiv.draggable

有没有办法将div重置为与启动状态相同的行为?或者有没有办法重新激活禁用的可拖动div


提前谢谢

没关系,我发现使用$theDiv.draggable'enable。它起作用了!