I'm a newbie in jQuery. I've searched the documentation and stackoverflow, and couldn't find an answer. I need to cancel last change in the sortable list when clicking on a button, and it works.
I also need to get the element (or the id of it), which has been moved to its previous position. How can I do it?
The code I have:
<script type="text/javascript">
$(function(){
$("#sortable").sortable({
placeholder: "ui-state-highlight",
opacity: 0.6
});
$("#cancelSort").click(function(){
$("#sortable").sortable("cancel");
});
});
</script>
<button id="cancelSort">Cancel Sort</button>
Thanks in advance!