Skip to content

Instantly share code, notes, and snippets.

@imagehat
Created June 17, 2009 22:11
Show Gist options
  • Save imagehat/131545 to your computer and use it in GitHub Desktop.
Save imagehat/131545 to your computer and use it in GitHub Desktop.
//Split into two columns
var marker = Math.round($('#sitemap > li').length / 2);
$('#sitemap > li').each(function(i) {
if (i >= marker) $(this).addClass('colsplit');
});
$('#sitemap li.colsplit').insertAfter('#sitemap').wrapAll('<ul class="columns-2"></ul>').removeClass('colsplit');
$('#sitemap').addClass("columns-2");
Copy link

ghost commented Mar 12, 2012

Great! Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment