Last active
May 17, 2016 21:28
-
-
Save erwstout/66a896bc51b187cac12034e55ee6829c to your computer and use it in GitHub Desktop.
Equalize Elements on load and window resize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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