jquery-ui 拖拽排序

 : 引入  
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

  

 <tbody id="sortable "><tr></tr></table>
 $(function() {
                $( "#sortable" ).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);
                    }
                });
                $( "#sortable" ).disableSelection();
            }); 

  

 
原文地址:https://www.cnblogs.com/lhy-93/p/5741506.html