Last active
March 18, 2016 01:04
-
-
Save brubrant/bb1a949a2876ef060ca3 to your computer and use it in GitHub Desktop.
Se equal height for all items.
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
function igualaAltura (itens) { | |
var maiorAlura = 0; | |
$(itens).each(function(index, el) { | |
$(el).css('height', 'auto'); | |
if ( $(el).height() > maiorAlura ) { | |
maiorAlura = $(el).height(); | |
} | |
}); | |
$(itens).each(function(index, el) { | |
$(el).height(maiorAlura); | |
}); | |
} | |
igualaAltura( $('.block p') ); | |
$( window ).resize(function() { | |
igualaAltura( $('.block p') ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment