Skip to content

Instantly share code, notes, and snippets.

@MatthewCallis
Created April 9, 2013 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MatthewCallis/5349949 to your computer and use it in GitHub Desktop.
Save MatthewCallis/5349949 to your computer and use it in GitHub Desktop.
jQuery Equal Heights
// Equal Heights
(function($){
$.fn.equalHeights = function(minHeight, maxHeight){
var tallest = (minHeight) ? minHeight : 0;
this.each(function(){
if($(this).height() > tallest){
tallest = $(this).height();
}
});
if((maxHeight) && tallest > maxHeight){
tallest = maxHeight;
}
return this.each(function(){
$(this).height(tallest).css("overflow","auto");
});
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment