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">'); | |
} | |
}); |
Questions, comments, or suggestion for improvement? Leave a comment on the GitHub Gist page.