jQuery实现table表格中行数据上下拖拽功能
$("#table").sortable({
cursor: "move",
axis: "y", //只在y轴进行拖动
item: "tr", //拖动的对象
opacity: 0.5, //拖动时,透明度为0.5
revert: false, //释放时,增加动画
cancel: "tfoot,thead", //禁止表头和表末拖拽
update: function(event,ui){
//拖拽:执行排序操作
$(this).sortable("toArray");
}
});