【发布时间】:2014-03-05 14:07:32
【问题描述】:
$("#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/
当我将几个框从源 UL 拖到目标时,它们变得非常难以排序,尤其是在尝试移动到开头时。常规排序适用于相同的 CSS。
我知道这是一个常见问题,但没有一种解决方案在这种特殊情况下有效。
【问题讨论】:
标签: jquery-ui jquery-ui-sortable jquery-ui-draggable