Last active
August 29, 2015 14:05
-
-
Save thierrypigot/2e6bca1f45720425f8e2 to your computer and use it in GitHub Desktop.
equalHeight.js
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 html element */ | |
function equalHeight( group ) | |
{ | |
var tallest = 0; | |
var thisHeight = 0; | |
group.each(function() { | |
thisHeight = jQuery(this).height(); | |
if(thisHeight > tallest) { | |
tallest = thisHeight; | |
} | |
}); | |
group.height( tallest ); | |
} | |
jQuery(document).ready(function(){ | |
equalHeight( jQuery(".equal-height-column") ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The script search for the bigger box (.equal-height-column css class in this exemple) and give this size to the smaller others.