Created
December 11, 2013 20:59
-
-
Save jaredatch/7918378 to your computer and use it in GitHub Desktop.
Split sub navigation items into columns
This file contains 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
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