Last active
August 29, 2015 14:02
-
-
Save edsilv/6fc9b370d70df642cf01 to your computer and use it in GitHub Desktop.
Equalise Element 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
$.fn.equaliseHeight = function () { | |
var maxHeight = -1; | |
// reset all heights to auto first so they can be re-measured. | |
this.each(function () { | |
$(this).height('auto'); | |
}); | |
this.each(function () { | |
maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height(); | |
}); | |
this.each(function () { | |
$(this).height(maxHeight); | |
}); | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment