Created
November 15, 2013 00:17
-
-
Save carlos-sanchez/7476879 to your computer and use it in GitHub Desktop.
Equalize heights of div elements. Equalizing heights of div elements is not possible (or very hacky) to do in pure CSS, so jQuery is here to help. The code below will automatically adjust the heights of div elements according to the higher one. Take a look at this alternative JQuery plugin: http://tsvensen.github.io/equalize.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
var maxHeight = 0; | |
$("div").each(function(){ | |
if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } | |
}); | |
$("div").height(maxHeight); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment