gpt4 book ai didi

javascript - Jquery 等高

转载 作者:行者123 更新时间:2023-11-30 10:48:30 25 4
gpt4 key购买 nike

我不知道我做错了什么..但我有 3 列我想应用相同的高度

这是我的html

    <div id="wrapper">
<div class="LeftBG"></div>
<div id="MainBlock">THIS IS A TEST</div>
<div class="RightBG"></div>
<!-- END CONTENT BLOCK -->
</div>

这是我的功能,但无法正常工作....

    var highestCol = Math.max(
$('.LeftBG').height(),
$('.RightBG').height());
$('#MainBlock').height(highestCol);

看看我在做什么click here

最佳答案

将您的代码更改为将所有三个 block 设置为相同的高度:

var highestCol = Math.max(
$('.RightBG').height(),
$('.LeftBG').height());
$('#MainBlock, .RightBG, .LeftBG').height(highestCol);

在这里查看:http://jsfiddle.net/jfriend00/Rv4fr/

关于javascript - Jquery 等高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6935521/

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