开发者

Equal Height not working in Safari (jQuery)

开发者 https://www.devze.com 2022-12-21 13:26 出处:网络
$.fn.equalHeight = function () { var height = 0, reset = $.browser.msie ? \"1%\" : \"auto\"; return this.css(\"height\", reset).each(function () {
$.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 -开发者_Go百科 height));
        }
    });
};

.. works great in Firefox and even the crappy IE6 but not Webkit (Safari, Chrome). How do I fix it?

Many thanks


Try to load your script with jQuery(window).load(), it solved my problem.

Read more here

0

精彩评论

暂无评论...
验证码 换一张
取 消