Skip to content

Instantly share code, notes, and snippets.

@aijodesigns
Created October 28, 2014 20:52
Show Gist options
  • Save aijodesigns/1418ceba261d7f93798b to your computer and use it in GitHub Desktop.
Save aijodesigns/1418ceba261d7f93798b to your computer and use it in GitHub Desktop.
Adding Class to UL based on number of child LIs
$(document).ready(function () {
$('#menu-main ul.sub-menu').each(function() {
if ($(this).children('li').length > 7) {
$(this).addClass('large');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment