jQuery(document).ready(function () { var CatalogElements = jQuery('.catalogElementBlock'); if ( CatalogElements.length ) { var MaxHeight = 0; for (i = 0; i < CatalogElements.length; i++) { if ( jQuery(CatalogElements[i]).height() > MaxHeight ) { MaxHeight = jQuery(CatalogElements[i]).height(); MaxHeight; } } jQuery(".catalogElementBlock").css( "height", MaxHeight ); } });