視窗 innerHeight
描述
innerHeight 屬性返回視窗內容區域的高度。
innerHeight 屬性是隻讀的。
語法
window.innerHeight或者innerHeight
返回值
| 型別 | 描述 |
| 一個數字 | 瀏覽器視窗內容區域的內部高度(以畫素為單位)。 |
更多示例
所有高度和寬度屬性
let text =
"<p>innerWidth: " + window.innerWidth + "</p>" +
"<p>innerHeight: " + window.innerHeight + "</p>" +
"<p>outerWidth: " + window.outerWidth + "</p>" +
"<p>outerHeight: " + window.outerHeight + "</p>";
自己動手試一試 »
瀏覽器支援
window.innerHeight 在所有瀏覽器中都受支援
| Chrome | Edge | Firefox | Safari | Opera | IE |
| 是 | 是 | 是 | 是 | 是 | 9-11 |