У меня есть:
<ul id="sortableList">
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
Я подключился к update: function(event, ui) { }
, но не уверен, как получить исходное и новое положение элемента. Если я перемещаю элемент 3 над пунктом 1, я хочу, чтобы исходная позиция была 2 (индекс на основе 0), а новая позиция элемента 3 была 0.