I need to measure the offsetHeight of a div that is inside of a hidden element.
13条回答 离开以前 (楼主) 2020-11-27 06:53 If you use style.display = "none", the element will have 0 width and height, but using the style.visibility = "hidden" instead, the element will have the width and height calculated by the browser (as normally). 0 讨论(0) 查看其它13个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
If you use style.display = "none", the element will have 0 width and height, but using the style.visibility = "hidden" instead, the element will have the width and height calculated by the browser (as normally).
style.display = "none"
style.visibility = "hidden"