Skip to content

Instantly share code, notes, and snippets.

@DavidQL
Created February 2, 2011 23:40
Show Gist options
  • Save DavidQL/808687 to your computer and use it in GitHub Desktop.
Save DavidQL/808687 to your computer and use it in GitHub Desktop.
$('aside.filter li').each(function() {
var this_class = $(this).attr('class'),
people_count = $('div#crew_list > div.'+this_class+' div.user').length,
percentage = ((((people_count / $('div#crew_list div.user').length)*100)).toString()+'%');
$(this)
.css('width',percentage)
.data('width',percentage)
.find('span')
.append(people_count);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment