Created
February 15, 2016 20:08
-
-
Save sibaberpollo/7baaa7a1049ed49ab1d0 to your computer and use it in GitHub Desktop.
Funciones para tener div con mismo alto y centrar imágenes según su posición
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 altoFila() { | |
$('.fila-eventos').each(function(){ | |
var highestBox = 0; | |
var width = $(window).width(); | |
if (width >= 768) { | |
$('.column', this).each(function(){ | |
if($(this).height() > highestBox) | |
highestBox = $(this).height(); | |
}); | |
console.log(highestBox); | |
$('.img-logo',this).css("line-height", highestBox+"px"); | |
} | |
}); | |
} | |
/* | |
$(document).ready(function(){ | |
$('.container').each(function(){ | |
var highestBox = 0; | |
$('.column', this).each(function(){ | |
if($(this).height() > highestBox) | |
highestBox = $(this).height(); | |
}); | |
$('.column',this).height(highestBox); | |
}); | |
}); | |
<div class="container"> | |
<div class="column">This is<br />the highest<br />column</div> | |
<div class="column">One line</div> | |
<div class="column">Two<br />lines</div> | |
</div> | |
<div class="container"> | |
<div class="column">One line</div> | |
<div class="column">Two<br>lines</div> | |
<div class="column">One line</div> | |
</div> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment