Skip to content

Instantly share code, notes, and snippets.

@nathancarnes
Created May 10, 2010 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nathancarnes/396692 to your computer and use it in GitHub Desktop.
Save nathancarnes/396692 to your computer and use it in GitHub Desktop.
$.fn.equalHeights = function(px) {
$(this).each(function(){
var currentTallest = 0;
$(this).children().each(function(i){
if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
});
//if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
// for ie6, set height since min-height isn't supported
if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); }
$(this).children().css({'min-height': currentTallest});
});
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment