gpt4 book ai didi

javascript - 如何在javascript中获取DIV对象的现实高度?

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

请参阅:demo

$("#stdout").height()

返回 18px

我想获取真实高度(height + padding + border)200px

怎么办?

感谢帮助:)

最佳答案

参见 .outerHeight()

$("#stdout").outerHeight();
// returns ( height + padding + border )

如果您还想包括边距:

$("#stdout").outerHeight( true );
// returns ( height + padding + border + margin )

关于javascript - 如何在javascript中获取DIV对象的现实高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4397749/

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