Equal column height with jQuery

Have you ever wanted all your divs (columns) to have the same height?

With CSS is a pain in the butt, here's how jQuery comes in handy.

This very cool snippet will get the highest value for your columns. Then you can asign them all the same height.


var highestCol = Math.max($('#col-1').height(),$('#col-2').height(),$('#col-3').height());

$('.columns').height(highestCol);

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*