我要保持这个简短而甜蜜。在 webkit 浏览器中,我应用到 [我的网站][1] 的自动调整大小功能似乎响应缓慢,只有在调整浏览器后才会出现。下面是我的 JS 的一个片段。
function setTheHeight() {
    if( $('.col-small, .img_hover').length ) {
        //Get value of highest element
        var maxHeight = Math.max.apply(Math, $('.col-small, .img_hover').map (
            function() {
                var totalHeight = 0;
                $(this).children().each(function() {
                    totalHeight += $(this).outerHeight(); 
                });
                return totalHeight;
            }
        ));
        console.log(maxHeight);
        $('.col-small, .img_hover').height(maxHeight);
    }   
}
setTheHeight();
$(window).resize(function() {
    setTheHeight();
});
我错过了什么吗?