Skip to content

Instantly share code, notes, and snippets.

@neilrenicker
Created April 8, 2013 17:54
Show Gist options
  • Save neilrenicker/5338917 to your computer and use it in GitHub Desktop.
Save neilrenicker/5338917 to your computer and use it in GitHub Desktop.
Resize all containing divs to the height of the tallest div.
$(document).ready(function() {
var resizer = function () {
var height = 0;
var tallest_h2;
$('.article-title').find('h2').each(function () {
if ($(this).outerHeight() > height ) {
tallest_h2 = this;
height = $(this).outerHeight();
}
});
$('.article-title').css({'min-height': height + 20});
};
resizer(); // set initially
$(window).on('resize', resizer); // adjust on browser resize
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment