I currently have a jQuery sortable list working perfectly. I am able to move the \'li\' elements around. However, how can I make a button to move a specific \'li\' element u
Based on @azatoth answer, if someone like to have the buttons for every record he can do it in this way (replace the li tag with your Sortable tag).
HTML:
jQuery:
$('.my-button-up').click(function(){
var current = $(this).closest('li');
current.prev().before(current);
});
$('.my-button-down').click(function(){
var current = $(this).closest('li');
current.next().after(current);
});