Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Setting equal height of DIVs inside their container? Reply To: [Solved] Setting equal height of DIVs inside their container?

#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).