且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery UI可排序-拖动项目时执行某些操作

更新时间:2023-10-30 21:11:22

您必须以这样的可排序方式添加更新事件:

You have to add update event at sortable like this :

     $(".sortableList").sortable({ 
            update: function(event, ui) {
               //alert("Do something here when item left!");
            },
            start: function(event, ui) {
               //alert("Do something here when item just dragged from sortable!");
        },
     });

因此,当从sortable拖动到位置update时,将触发事件,而拖动时将触发.start.

So when the dragged from sortable is left to the position update event will trigger and when it dragged .start is triggered.