Cancel dragging of a sortable item

后端 未结 4 538
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 00:16

An absolutely common sortable case:



  • Item
4条回答
  •  天命终不由人
    2021-02-04 01:12

    The sort function callback does the same for sort as drag for draggable (demo):

    $("#sortable").sortable({
        sort: function() {
            if ($(this).hasClass("cancel")) {
                $(this).sortable("cancel");
            }
        }
    });
    

提交回复
热议问题