我想在刪除容器上的<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