gpt4 book ai didi

JQuery .height(x) 在 IE8 中加倍?

转载 作者:行者123 更新时间:2023-11-28 14:15:09 24 4
gpt4 key购买 nike

我在包装器中有一系列 Div,我需要使两列的高度相等。我们使用一个简单的 jQuery 插件来执行此操作,它会触发以下函数:

//find heights of all children, and find the tallest
this.each(function() {
if ($(this).height() > tallest) {
tallest = $(this).height();
}
});
if ((maxHeight) && tallest > maxHeight) tallest = maxHeight;
//assign the tallest height to all child elements
return this.each(function() {
console.log('tallest: ' + tallest);
$(this).height(tallest).css("overflow", "visible");
});

console.log 在 IE8 中显示 2131px 的高度,然而,目标 div 被赋予 4262px 的高度(正好是两倍?)。我单步执行了代码,我看到 .height(tallest) 正在以正确的值执行,但不知何故 IE8 并且只有 IE8 给它双倍高度。

编辑:

到目前为止我已经尝试过 .height(2131) .height('2131px') .css("height","2131px").css('最小高度', "2131px")。都具有相同的效果。想出一个用例可能有点困难,因为这是一个大型的“企业级”系统,但我会看看是否可以复制它...

最佳答案

有趣的是,.height() jQuery documentation评论中出现大量IE8的评论,最终导致this other SO question这也可能对您有所帮助。

关于JQuery .height(x) 在 IE8 中加倍?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9135277/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com