드래그 앤 드롭을 시뮬레이트하기 위해 Jquery UI를 사용하려고합니다. 끌어서 놓을 때 원본 목록에서 항목을 제거하지 못하게하는 방법은 무엇입니까? 이 경우 갤러리에 항목을 보관하고 있지만 휴지통에 복제하고 싶습니다.Jquery droppable이 요소를 제거하지 않습니다.
Jsbin 예 http://jsbin.com/igevut/1/edit
$trash.droppable({
accept: "#gallery > li",
activeClass: "ui-state-highlight",
drop: function(event, ui) {
deleteImage(ui.draggable);
}
});
function deleteImage($item) {
$item.fadeOut(function() {
var $list = $("ul", $trash).length ?
$("ul", $trash) :
$("<ul class='gallery ui-helper-reset'/>").appendTo($trash);
$item.find("a.ui-icon-trash").remove();
$item.append(recycle_icon).appendTo($list).fadeIn(function() {
$item
.animate({ width: "48px" })
.find("img")
.animate({ height: "36px" });
});
});
}