Forked from DESIGNfromWITHIN/setAllToMaxHeight.js
Created
September 17, 2012 19:42
-
-
Save donpe/3739340 to your computer and use it in GitHub Desktop.
Equal height div's using jQuery - (Thx: PAUL IRISH via: http://www.broken-links.com/2009/01/20/very-quick-equal-height-columns-in-jquery/)
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.setAllToMaxHeight = function(){ | |
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) ); | |
} | |
// usage: $(‘div.unevenheights’).setAllToMaxHeight(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// To use in $(window).load - Thanks Paul Irish https://gist.github.com/3169543
$(window).load(function() {
$.fn.setAllToMaxHeight = function(){
return this.height(Math.max.apply(this, $.map(this, function(e){
return $(e).height()
})));
};
});