Skip to content

Instantly share code, notes, and snippets.

@brubrant
Last active March 18, 2016 01:04
Show Gist options
  • Save brubrant/bb1a949a2876ef060ca3 to your computer and use it in GitHub Desktop.
Save brubrant/bb1a949a2876ef060ca3 to your computer and use it in GitHub Desktop.
Se equal height for all items.
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