Skip to content

Instantly share code, notes, and snippets.

@jdlich
Created November 5, 2010 19:24
Show Gist options
  • Save jdlich/664638 to your computer and use it in GitHub Desktop.
Save jdlich/664638 to your computer and use it in GitHub Desktop.
function wrapEveryFour(children) {
for (var i = 0; i < (children.length / 4); i++) {
children.splice(0,4).wrapAll(container);
}
}
$('#content > section').each(function() {
var children = $(this).children('section');
wrapEveryFour(children);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment