Created
September 4, 2014 14:43
-
-
Save neverything/3ca85f60fe0c137b6c1c to your computer and use it in GitHub Desktop.
Function to simply set elements next to each other to equal height.
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
// Equal Height for Frontpage Articles | |
if ($(window).width() > 1000) { | |
setEqualHeightColumns( $('.sidebar-front-top .box') ); | |
}; | |
function setEqualHeightColumns($elements) { | |
var tallestBox = 0; | |
$elements.each(function() { | |
var thisHeight = $(this).height(); | |
if (thisHeight > tallestBox) { | |
tallestBox = thisHeight; | |
} | |
}); | |
$elements.height(tallestBox); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment