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
If you have following html code:
- line_1
- line_2
- line_3
I assume you have allready something to mark each li
s, so following I assume the marked li
has the class markedLi
; Following code should in theory move that element up or down (totally untested off course):
$('#myButtonUp').click(function(){
var current = $('.markedLi');
current.prev().before(current);
});
$('#myButtonDown').click(function(){
var current = $('.markedLi');
current.next().after(current);
});