查看元素是否已 "dragged" 的函数

function to see if element has been "dragged"

好的,我想使用 Jquery sortable 对列表进行排序。

当列表项向上或向下移动时,我想使用 jquery/ajax.

将当前排序保存到数据库中

但是如何检查项目是否已移动?有没有可以检查的函数?

有几个事件:http://api.jqueryui.com/sortable/。 只需将侦听器 'stop' 事件添加到 http://api.jqueryui.com/sortable/#event-stop,并为其定义回调。

$( ".selector" ).sortable({
  stop: function( event, ui ) {}
});