等高不在Safari(jQuery)中工作

3zz*_*zzy 1 javascript browser safari jquery equals

$.fn.equalHeight = function () {
    var height = 0,
        reset = $.browser.msie ? "1%" : "auto";
    return this.css("height", reset).each(function () {
        height = Math.max(height, this.offsetHeight);
    }).css("height", height).each(function () {
        var h = this.offsetHeight;
        if (h > height) {
            $(this).css("height", height - (h - height));
        }
    });
};
Run Code Online (Sandbox Code Playgroud)

..在Firefox中运行良好,甚至是糟糕的IE6,但不适用于Webkit(Safari,Chrome).我如何解决它?

非常感谢

Mir*_*rko 7

尝试加载你的脚本jQuery(window).load(),它解决了我的问题.

在这里阅读更多