Skip to content

Instantly share code, notes, and snippets.

@csknk
Forked from norcross/equal-heights.js
Created October 9, 2013 07:28
Show Gist options
  • Save csknk/6897521 to your computer and use it in GitHub Desktop.
Save csknk/6897521 to your computer and use it in GitHub Desktop.
//********************************************************
// function for calculating heights
//********************************************************
function equalHeight(group) {
var tallest = 0;
group.each(function() {
var thisHeight = jQuery(this).height();
if(thisHeight > tallest) {
tallest = thisHeight;
}
});
group.height(tallest);
}
// how to use
jQuery(document).ready( function($) {
$('div.MY-OUTER-CONTAINER').each(function() {
equalHeight($('DIV.THINGS-TO-EQUAL'));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment