I said 'something like' :)
Try this:
$('#mylist ul').click(function(e){
var sorted = $.makeArray($('#mylist ul li')).sort(function(a,b){
return ($(a).text() < $(b).text()) ? -1 : 1;
});
$('#mylist ul').html(sorted);
});
On Apr 24, 1:46 pm, hollow wrote
mkmanning
Thanks for the response.
Yes, but this doesn't give me the result
i've changed it to work on click
but the result doesn't appear all li's disappears.
$('#mylist ul').click(function(){
var sorted = $.makeArray($('#mylist ul li')).sort(function(a,b){
return $(a)
Something like this?
var sorted = $.makeArray($('ul li')).sort(function(a,b){
return $(a).text() > $(b).text();
});
$('ul').html(sorted);
On Apr 24, 9:16 am, hollow wrote:
> Hi as the title says i'm looking to order a list taht is created by
> drag and drop.
>
> the structure is a norm
3 matches
Mail list logo