Return to Snippet

Revision: 40620
at February 4, 2011 12:08 by BrunoDeBarros


Initial Code
(function($) {
    $.fn.equalHeights = function(minHeight, maxHeight) {
        tallest = (minHeight) ? minHeight : 0;
        this.each(function() {
            if($(this).height() > tallest) {
                tallest = $(this).height();
            }
        });
        if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
        return this.each(function() {
            $(this).height(tallest).css("overflow","auto");
        });
    }
})(jQuery);

Initial URL

                                

Initial Description
This allows you to set any number of elements to the same height. Took it from filamentgroup.com, so credit goes to them. Just putting it here so I can access it at any time.

Usage: `$('.columns').equalHeights(minHeight, maxHeight)`

Initial Title
Make all elements/columns/containers/boxes the same height

Initial Tags

                                

Initial Language
JavaScript