Make elements the same height

Make elements have the same height based on the tallest element of the group. By passing a string with the element selector you can select which elements are affected. If no parameter is passed the function looks for elements with the class premise-same-height.

How do I use it?

Lets say I have a grid with 4 columns and all columns have the same class – col_class – but different heights. The following code will set the min-height of all my columns to tallest column’s height.

$(document).ready(function(){
	premiseSameHeight( '.col_class' );
});

 

See a demo.

Tip: Always make sure to call your functions after the DOM is ready. Enjoy!

Send us your comments..

Your email address will not be published. Required fields are marked *