Created
April 28, 2013 14:45
-
-
Save chris-jamieson/5477072 to your computer and use it in GitHub Desktop.
Simple JavaScript / jQuery code to set equal heights to elements. Original snippet from Paul Irish
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 */ | |
$.fn.setAllToMaxHeight = function(){ | |
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) ); | |
} | |
$(window).load(function() { | |
$('#elementID, .elementClass').setAllToMaxHeight(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment