2
$("#source li").draggable({
appendTo: "#destination",
helper: "clone",
connectToSortable: "#destination",
containment: "document"
});
$("#destination").sortable({
items: "li:not(.placeholder)",
connectWith: "li",
placeholder: "dragging-placeholder",
sort: function() {
$(this).removeClass("ui-state-default");
},
over: function() {
$(".placeholder").hide();
},
out: function() {
if ($(this).children(":not(.placeholder)").length === 0) {
$(".placeholder").show();
}
}
});
的jsfiddle:http://jsfiddle.net/j9FK5/7/jQuery UI的拖動和排序 - 很難區分
當我從源UL到目標拖了幾箱,他們變得非常難以梳理,試圖移到尤其是當開始。定期排序可以使用相同的CSS。
我知道這是一個常見問題,但沒有一個解決方案在這種特殊情況下工作。
謝謝!這是一個很大的改進。它有時還滯後(即似乎跳過某些位置),但沒有人期望這些東西是完美的。 –