Skip to content

Instantly share code, notes, and snippets.

@slimelbasti
Created May 4, 2017 13:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slimelbasti/c29aa281cdd3eb86c98bb695d8baff91 to your computer and use it in GitHub Desktop.
Save slimelbasti/c29aa281cdd3eb86c98bb695d8baff91 to your computer and use it in GitHub Desktop.
height equalize function
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