I cannot find out how to obtain destination element with jQuery UI sortable.
$(\"#pages\").sortable({
opacity: 0.6,
update: function(even
Try using the serialize function which gives you a hash of the list of items in order.
If you just need the item that the new item go dropped before you can do this:
$("#pages").sortable({
opacity: 0.6,
update: function(event, ui) {
var first = ui.item; // First element to swap
var second = ui.item.prev();
swapOnServer(first, second);
}
});
second will be null if its at the start of the list.