我想在删除容器上的<div>
时删除它的拖动属性。但是我得到了一个错误"Property 'draggable' of object #<Object> is not a function"
,我的代码如下。ui.draggable(“destroy”)的jquery ui错误
$("#fighter1").draggable(); //fighter1 is the id of draggable object
$("#fighter2").draggable();
$("#fighter3").draggable();
$("#fighter4").draggable();
$("#fighter5").draggable();
$("#fighter6").draggable();
$("#dest").droppable({ //dest is the id of droppable object
drop: function(event, ui) {
ui.draggable("destroy"); //I get error here.
}
});
我使用jQuery UI的版本1.8.12
不相关的问题,但你可能要考虑当你有这么多的时候使用一个类作为可拖动的。例如:'$(“.draggable”).draggable();' – mekwall 2012-04-05 08:22:42