Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('tbody:first').append($('tbody:first > tr').sort(function(a, b) {
- return parseInt($('.vote-count-post',b).text(),10) - parseInt($('.vote-count-post',a).text(),10);
- }))
- var sum = 0;
- $('tbody:first > tr').each(function(){
- sum += parseInt($('.vote-count-post',this).text(),10)
- }).each(function(){
- var vote = $('.vote-count-post',this);
- $('<span>').text(parseInt((+vote.text()*100)/sum)+"%").insertAfter(vote);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement