Jq-table 拖拽顺序

发布时间 2023-07-13 09:56:33作者: .拾贰

使用sortable 对table列表进行拖拽排序

 <table id="sort" name="Register_GameId" class="table table-bordered"></table>

js代码

$(function () {//拖拽ibc游戏顺序
    $("#sort").sortable({
        cursor: "move",
        items: "tr", //只是tr可以拖动  
        opacity: 0.6, //拖动时,透明度为0.6  
        revert: true, //释放时,增加动画  
        update: function (event, ui) { //更新排序之后  
            var categoryids = $(this).sortable("toArray");
            var $this = $(this);
        }
    });
    $("#sort").disableSelection();//禁用选择匹配的元素集合内的文本内容。
});