Created
April 9, 2013 22:21
-
-
Save MatthewCallis/5349949 to your computer and use it in GitHub Desktop.
jQuery Equal Heights
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
// 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