Window innerWidth 和 innerHeight 屬性

定義和用法
innerheight 返回窗口的文檔顯示區(qū)的高度。
innerwidth 返回窗口的文檔顯示區(qū)的寬度。
注意:使用 outerWidth 和 outerHeight 屬性獲取加上工具條與滾動條窗口的寬度與高度。
語法
Get:
window.innerWidth
window.innerHeight
window.innerHeight
設(shè)置:
window.innerWidth=pixels
window.innerHeight=pixels
window.innerHeight=pixels
瀏覽器支持
所有主流瀏覽器都支持 innerWidth 和 innerHeight 屬性。
注意:IE 8 及更早 IE版本不支持這兩個屬性。
實(shí)例

更多建議: