Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("ul#sidebar_whatever").sortable({
- placeholder: "ui-state-highlight",
- update: function(event, ui) { //this is where we'll do some updating crap
- $("ul#sidebar_whatever").find('li.widget').each(function(){
- var val = $(this).find('input.hidden_cool_input').val();// this val will be like "124,1"
- var result = val.split(',');
- var order = $("ul#sidebar_whatever li.widget").index($(this))//getting the order of the current element in the loop
- result[1] = order; // we're reassigning the order
- $(this).find('input.hidden_cool_input').val(result.toString());//we're putting the values back in, as "124,0" or "125,3" or whatever.
- })
- }
- });
- /*class ".ui-state-highlight" is a class that will highlight where you are supposed to drag the small widget.*/
Add Comment
Please, Sign In to add comment