Skip to content

Instantly share code, notes, and snippets.

@sibaberpollo
Created February 15, 2016 20:08
Show Gist options
  • Save sibaberpollo/7baaa7a1049ed49ab1d0 to your computer and use it in GitHub Desktop.
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
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