Set Div Height to Height of Max Div in Sequence

Use the following snippet to identify the tallest div in the sequence and force all the same level divs to match height with it.

var maxheight = 0;

jQuery('.element').each(function () {
    maxheight = (jQuery(this).height() > maxheight ? jQuery(this).height() : maxheight); 
});

jQuery('.element').height(maxheight);

Sourced here.

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.