Skip to content

Instantly share code, notes, and snippets.

@chris-jamieson
Created April 28, 2013 14:45
Show Gist options
  • Save chris-jamieson/5477072 to your computer and use it in GitHub Desktop.
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
/* 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