Window outerWidth 和 outerHeight 屬性

定義和用法
outerHeight屬性設置或返回一個窗口的外部高度,包括所有介面元素(如工具欄/滾動條)。
outerWidth屬性設置或返回窗口的外部寬度,包括所有的介面元素(如工具欄/滾動)。
注意: 使用 innerWidth 和 innerHeight 屬性獲取去除工具條與滾動條的窗口高度與寬度。
語法
Get:
window.outerWidth
window.outerHeight
window.outerHeight
Set:
window.outerWidth=pixels
window.outerHeight=pixels
window.outerHeight=pixels
流覽器支持
所有主流流覽器都支持 outerWidth 和 outerHeight 屬性。
注意:IE 8 及更早 IE 版本不支持該屬性。
實例
實例
獲取窗口的高度與寬度(包括工具欄/滾動):
var w=window.outerWidth;
var h=window.outerHeight;
var h=window.outerHeight;
