[英]document.getElementById('').scrollHeight doesn't get the actual height
我有一個div,它會嵌套文本,圖像會更頻繁地更改,因此div的高度也會相應更改。
我需要確定div的高度。
我已經嘗試過jQuery $("div#ID").height();
但是它總是返回小於實際高度的值,請幫忙嗎?
也許你應該嘗試,
$("#divID").outerHeight();
$("#divID").outerHeight(true); //includes margin of element
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.