Window innerHeight ของ Window
- หน้าก่อน getComputedStyle()
- หน้าต่อไป innerWidth
- กลับไปหน้าเดิม Window 对象
คำอธิบายและการใช้งาน
innerHeight
ขอบเขตคืนค่าความสูงของโซนเนื้อหาหน้าต่าง
innerHeight
ขอบเขตเป็นการอ่านเพียงครั้งเดียว
ดูเพิ่มเติม
ตัวอย่าง
ตัวอย่าง 1
เรียกความสูงหน้าต่าง
let height = window.innerHeight;
let height = innerHeight;
ตัวอย่าง 2
ทั้งหมดคุณสมบัติความสูงและความกว้าง
let text = "<p>innerWidth: " + window.innerWidth + "</p>" + "<p>innerHeight: " + window.innerHeight + "</p>" + "<p>outerWidth: " + window.outerWidth + "</p>" + "<p>outerHeight: " + window.outerHeight + "</p>";
โครงสร้าง
window.innerHeight
หรือ
innerHeight
ค่าที่คืนค่า
ชนิด | การอธิบาย |
---|---|
ตัวเลข | ความสูงของโซนเนื้อหาหน้าต่างเบราซเวอร์ (นับด้วยพิกเซล) |
การสนับสนุนของเบราซเวอร์
ทุกเบราซเวอร์สนับสนุน window.innerHeight
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
สนับสนุน | 9-11 | สนับสนุน | สนับสนุน | สนับสนุน | สนับสนุน |
- หน้าก่อน getComputedStyle()
- หน้าต่อไป innerWidth
- กลับไปหน้าเดิม Window 对象