我使用的是jquery拖放元素,该元素完美地拖放到了放置区域,但我希望它回到其原始位置。但这并没有回来。请帮忙.. 这是我的代码
function makedraggable() {
$(".qitem2").draggable({
revert : "invalid",
});
}
makedraggable();
$(".droppable-element").droppable({
"activeClass": "ui-state-hover",
"hoverClass" : "ui-state-active",
"accept": ".qitem2",
"drop": function(event, ui) {
if ($(this).find(".qitem2").length) {
var $presentChild = $(this).find(".qitem2"),
currChildId = $presentChild.attr("id"),
$currChildContainer = $("#" + currChildId + "-container");
$currChildContainer.append($presentChild);
$presentChild.removeAttr("style");
// makedraggable();
}
$(ui.draggable).clone().appendTo(this).removeAttr("style");
$(ui.draggable).remove();
makedraggable();
},
"out": function (event, ui) {
$(this).css("background-color", "")
}
})
$.ui.draggable.prototype.destroy = function (ul, item) { };
})