Skip to content

Instantly share code, notes, and snippets.

@kadavre
Created June 16, 2017 11:13
Show Gist options
  • Save kadavre/b51f46407456dd6fb0ae37ca436d1e07 to your computer and use it in GitHub Desktop.
Save kadavre/b51f46407456dd6fb0ae37ca436d1e07 to your computer and use it in GitHub Desktop.
var equalizeHeights = function () {
$(".equalizer").each(function(ix, el) {
var heights = $(el).find('.eq-watch').map(function() {
return $(this).height();
}).get();
maxHeight = Math.max.apply(null, heights);
$(el).find('.eq-watch').height(maxHeight);
});
};
equalizeHeights();
$(window).resize(function() {
equalizeHeights();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment