Skip to content

Instantly share code, notes, and snippets.

@erwstout
Last active May 17, 2016 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erwstout/66a896bc51b187cac12034e55ee6829c to your computer and use it in GitHub Desktop.
Save erwstout/66a896bc51b187cac12034e55ee6829c to your computer and use it in GitHub Desktop.
Equalize Elements on load and window resize
var equalize = function() {
var max = Math.max.apply(null,
$('.equalize').css('height', 'auto').map(function() {
return $(this).outerHeight();
})
);
$('.equalize').outerHeight(max);
};
// equalize
$(window).resize(function() {
equalize();
}).trigger('resize');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment