Equalize Columns Height

/** * Equalize Heights of Divs * @author Chris Coyier * @link https://css-tricks.com/snippets/jquery/equalize-heights-of-divs/ * @param {string} HTML tag name, class or attribute. */ jQuery(document).ready(function($) { function equalizeHeight(element) { var maxHeight = 0; $(element).each(function() { if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } }); $(element).height(maxHeight); } });
A quick, simple snippet that automatically take all columns and equalizes their height according to the tallest element. Definitely more reliable than Foundation 5's "Equalizer" plugin!

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.