Skip to content

Instantly share code, notes, and snippets.

@m-coding
Forked from donpe/setAllToMaxHeight.js
Created April 3, 2016 01:12
Show Gist options
  • Save m-coding/215d68cf2f39dfa931e8d7abde47e51b to your computer and use it in GitHub Desktop.
Save m-coding/215d68cf2f39dfa931e8d7abde47e51b 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/)
$.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