Skip to content

Instantly share code, notes, and snippets.

@neverything
Created September 4, 2014 14:43
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 neverything/3ca85f60fe0c137b6c1c to your computer and use it in GitHub Desktop.
Save neverything/3ca85f60fe0c137b6c1c to your computer and use it in GitHub Desktop.
Function to simply set elements next to each other to equal height.
// 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