Home › Forums › CSS › [Solved] Setting equal height of DIVs inside their container? › Reply To: [Solved] Setting equal height of DIVs inside their container?
July 21, 2014 at 8:12 am
#176018
r00t
Participant
Just use the function that I wrote here (jQuery):
$.fn.equalHeights = function(px) {
var currentTallest = 0;
$.each($(this), function(i, v) {
if ($(v).outerHeight() > currentTallest) {
currentTallest = $(v).outerHeight();
}
return true;
});
$.each($(this), function(i, v) {
$(v).css({
"height": currentTallest
});
return true;
});
}
Then use:
$('#container').equalHeights();
Way better than Flexbox at this point (due to its limited support).