当它最初设置为“无效”时,是否可以将可拖动的恢复值设置为“真”?我试图在 droppable 的 drop 事件中恢复可拖动,但恢复不会发生。
var dragOpts = {
/* appendTo: "body", */
zIndex: 1000,
cursor: "move",
revert: "invalid",
opacity: 0.45,
helper: myHelper,
};
$(".appointment").draggable(dragOpts);
function myHelper(event, ui) {
var height = $(this).children().not('.travel-element').css("height");
var cloneClass = $(this).children().not('.travel-element').attr("class");
return $("<div id='helper' class='" + cloneClass + "' style='height:" + height + "'>Moving</div>");
}
drop: function (e, ui) {
$(".appointment").draggable({revert:true});
}