Created
April 12, 2011 07:14
-
-
Save andyford/915094 to your computer and use it in GitHub Desktop.
equalHeights jQuery Plugin
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
/*! | |
* equalHeights jQuery Plugin | |
*/ | |
(function($){ | |
$.fn.equalHeights = function() { | |
var tallest = 0, | |
current = 0; | |
this.each(function(){ | |
current = $(this).height(); | |
if(current > tallest) { | |
tallest = current; | |
} | |
}); | |
return this.height(tallest); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use on any collection:
$('div.grid > div.box').equalHeights();
$('.whatever').equalHeights();
etc