Created
April 26, 2013 20:38
-
-
Save fredacx/5470287 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ordenação | |
$('#maisvotados').on('click', function(){ | |
array = new Array(); | |
var i = 1; | |
$('.item-votacao').each(function(){ | |
i+=1; | |
array[($(this).data('votos')+1) +''+ i] = $(this); | |
}); | |
array.sort(function(a,b) { | |
return a > b; | |
}); | |
console.log(array); | |
$('.item-geral ul').hide(); | |
$('.item-geral ul').empty(); | |
for(var i in array) { | |
console.log(i); | |
$('.item-geral ul').append(array[i]); | |
$('.item-geral ul').fadeIn('slow'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment