1
我正在尝试做一些非常简单的事情。我正在尝试使用JQuery UI对表进行排序,并将Draggable拖到不同的div上,我将它用作垃圾桶。我有以下脚本。但由于某种原因拖动和排序冲突Sortable table and Draggable TR
$("#TBL_OUTPUT").sortable({
items: 'tr:not(:first)'
});
$("#TBL_OUTPUT tr").draggable({
helper: "clone",
start: function(event, ui) {
c.tr = this;
c.helper = ui.helper;
}
});
$("#TRASHCAN").droppable({
hoverClass: "TRASH_Hover",
drop: function(event, ui) {
$(c.tr).remove();
$(c.helper).remove();
}
});
有什么想法?
只需使用'connectWith'属性,只使用排序。你不需要拖动和拖放。 – boszlo
感谢boszlo,我试过你的建议,但connectWith不工作。元素TRASHCAN实际上是一个div ..所以我想知道这是否可能是原因? –
没问题。 'Div's很好。我现在已经完全回答了你的问题。如果您满意,请接受/投票。 – boszlo