aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/outerheight/index.html
blob: fe528e036f079bcc6c07f664bb01db40992c08d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
title: Window.outerHeight
slug: Web/API/Window/outerHeight
translation_of: Web/API/Window/outerHeight
---
<div>
 {{APIRef}}</div>
<h2 id="Summary" name="Summary">概述</h2>
<p><code>Window.outerHeight</code> 获取整个浏览器窗口的高度(单位:像素),包括侧边栏(如果存在)、窗口镶边(window chrome)和窗口调正边框(window resizing borders/handles)。</p>
<p>该属性为只读,没有默认值。</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><var>outWindowHeight</var> = window.outerHeight;
</pre>
<p><code>outWindowHeight</code> 为窗口的外层的高度。</p>
<h2 id="Notes" name="Notes">备注</h2>
<p>要改变窗口的大小,请查看 {{domxref("window.resizeBy()")}}{{domxref("window.resizeTo()")}}</p>
<p>要获取窗口的内层高度,即页面被显示区域的高度,可查看 {{domxref("window.innerHeight")}}</p>
<h3 id="Graphical_example" name="Graphical_example">图像示例</h3>
<p>下面的示意图展示了 <code>outerHeight</code><code>innerHeight</code> 两者的不同。</p>
<p><img alt="innerHeight vs outerHeight illustration" src="/@api/deki/files/213/=FirefoxInnerVsOuterHeight2.png" style=""></p>
<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2>
<div>
{{Compat("api.Window.outerHeight")}}

<h2 id="Specification" name="Specification">规范</h2>
<p>DOM Level 0。不属于任何 W3C 技术规范或推荐。</p>
<h2 id="相关链接">相关链接</h2>
<ul>
 <li>{{domxref("window.innerHeight")}}</li>
 <li>{{domxref("window.innerWidth")}}</li>
 <li>{{domxref("window.outerWidth")}}</li>
 <li>{{domxref("window.resizeBy()")}}</li>
 <li>{{domxref("window.resizeTo()")}}</li>
</ul>