Window outerWidth 属性
描述
outerWidth 属性返回浏览器窗口的外部宽度,包括所有界面元素(例如工具栏/滚动条)。
outerWidth 属性为只读属性。
语法
window.outerWidthor just:
outerWidth
返回值
| 类型 | 描述 |
| 一个数字 | 浏览器窗口的宽度,包括所有界面元素,以像素为单位。 |
更多示例
所有高度和宽度属性:
let text =
"<p>innerWidth: " + window.innerWidth + "</p>" +
"<p>innerHeight: " + window.innerHeight + "</p>" +
"<p>outerWidth: " + window.outerWidth + "</p>" +
"<p>outerHeight: " + window.outerHeight + "</p>";亲自试一试 »浏览器支持
window.outerWidth 所有浏览器均支持:
| Chrome | Edge | Firefox | Safari | Opera | IE |
| Yes | Yes | Yes | Yes | Yes | 9-11 |
