Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created December 11, 2013 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/7918378 to your computer and use it in GitHub Desktop.
Save jaredatch/7918378 to your computer and use it in GitHub Desktop.
Split sub navigation items into columns
jQuery(function($){
var allItems = $('.menu-item-services .sub-menu li');
var itemsPerColumn = Math.round( allItems.length / 2 );
for (var i = 0; i < allItems.length; i += itemsPerColumn) {
allItems.slice(i, i + itemsPerColumn).wrapAll('<div class="column">');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment