Skip to content

Instantly share code, notes, and snippets.

@vremy
Last active August 29, 2015 14:22
Show Gist options
  • Save vremy/d5aff4416c6fe103e5ee to your computer and use it in GitHub Desktop.
Save vremy/d5aff4416c6fe103e5ee to your computer and use it in GitHub Desktop.
equalizer.js
/**
* Equalizer by Geo
* Equalizer all div heights inside a div
*/
function equalizer(cssPath) {
var element = $(cssPath);
var maxHeight = Math.max.apply(null, element.map(function() {
return $(this).outerHeight();
}).get());
element.css('height', maxHeight + 'px');
return false;
}
//Usage Equalizer
$(window).load(function() {
equalizer('.your-wrapper > div');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment