Skip to content

Instantly share code, notes, and snippets.

@robballou
Created August 15, 2012 16:30
Show Gist options
  • Save robballou/3361407 to your computer and use it in GitHub Desktop.
Save robballou/3361407 to your computer and use it in GitHub Desktop.
(function($){
$(document).ready(function(){
$('.section-header').each(function(){
var $this = $(this);
// use .add() and .nextUntil() to get both the .section-header
// and .section-item elements into a single set for our .wrapAll() call
$this.add($this.nextUntil('.section-header', '.section-item'))
.wrapAll('<div class="section-container"></div>');
});
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment