我對jQuery有點新,希望有人能幫助我。jQuery droppables - 更改元素下降
我試圖在(li)被刪除後將元素(li)更改爲另一個元素(div)。
樣品的編號:
$("#inputEl>li").draggable({
revert: true,
opacity: 0.4,
helper: "clone"
});
$("#dropEl")
.droppable({
accept: ".drag",
hoverClass: "dropElhover",
drop: function(ev, ui) {
// change the li element to div here
}
});
的問題是,當我使用
drop: function(ev, ui) {
$(ui.draggable).replaceWith("<div>Some content</div>");
}
上面的功能被觸發時的原始可拖動元件將被禁用。
我正在使用最新的jQuery和jQuery UI穩定版本。