blob: fc7a7ca3db2802fc926795f65f9ac56a8a982675 (
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
|
---
title: Window.outerWidth
slug: Web/API/Window/outerWidth
translation_of: Web/API/Window/outerWidth
---
<div>
{{APIRef}}</div>
<h2 id="Summary" name="Summary">概述</h2>
<p><code>Window.outerWidth</code> 获取浏览器窗口外部的宽度。表示整个浏览器窗口的宽度,包括侧边栏(如果存在)、窗口镶边(window chrome)和调正窗口大小的边框(window resizing borders/handles)。</p>
<p>该属性为只读,没有默认值。</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><var>outWindowWidth</var> = window.outerWidth;
</pre>
<p><code>outWindowWidth</code> 是窗口的外层的宽度。</p>
<h2 id="Notes" name="Notes">备注</h2>
<p>要改变一个窗口的大小,可参考 {{domxref("window.resizeBy()")}} 和 {{domxref("window.resizeTo()")}}。</p>
<p>要获取一个窗口的内层宽度(inner width),即页面被展示的区域,请参考 {{domxref("window.innerWidth")}}。</p>
<h2 id="浏览器兼容性">浏览器兼容性</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 技术规范或推荐。<span class="comment">the To do in Notes</span></p>
<h2 id="相关链接">相关链接</h2>
<ul>
<li>{{domxref("window.outerHeight")}}, {{domxref("window.innerHeight")}}, {{domxref("window.innerWidth")}}</li>
<li>{{domxref("window.resizeBy()")}}, {{domxref("window.resizeTo()")}}</li>
</ul>
|