Created
April 8, 2013 17:54
-
-
Save neilrenicker/5338917 to your computer and use it in GitHub Desktop.
Resize all containing divs to the height of the tallest div.
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
$(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