aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/outerheight/index.html
blob: 9bc6b127af97de1c3c7262ec22a8a012b04dc658 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
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>
 {{CompatibilityTable}}</div>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>1</td>
    <td>{{CompatGeckoDesktop(1.0)}}</td>
    <td>9</td>
    <td>9</td>
    <td>3</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Mobile</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>1</td>
    <td>{{CompatGeckoMobile(1.0)}}</td>
    <td>9</td>
    <td>9</td>
    <td>3</td>
   </tr>
  </tbody>
 </table>
</div>
<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>