Equal Height Columns Using jQuery

Posted in: - Apr 16, 2011 No Comments
/* Plugin to make variable height divs equal heights */
$.fn.sameHeights = function() {

$(this).each(function(){
var tallest = 0;

$(this).children().each(function(i){
if (tallest < $(this).height()) { tallest = $(this).height(); }
});
$(this).children().css({'height': tallest});
});
return this;
};

Call Function

$(document).ready(function(){

 /* Make boxes same height */
 $('.boxes').sameHeights();

});

Reference


No Responses to “Equal Height Columns Using jQuery”

Leave a Reply