aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/window/innerwidth/index.html
blob: 129b4a93473f58530500fcc9013e4a4e4f883f0a (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
78
---
title: Window.innerWidth
slug: Web/API/Window/innerWidth
tags:
  - API
  - Property
  - Reference
translation_of: Web/API/Window/innerWidth
---
<p>{{APIRef}}<br>
 브라우저 윈도우의 뷰포트 너비로, 수직 스크롤바가 존재한다면 포함합니다.</p>

<h2 id="Syntax" name="Syntax">구문</h2>

<p> </p>

<pre>var <var>intViewportWidth</var> = window.innerWidth;</pre>

<h3 id="Value">Value</h3>

<p><strong><var>intViewportWidth</var></strong> stores the <code>window.innerWidth</code> property value.</p>

<p>The <code>window.innerWidth</code> property is read only; it has no default value.</p>

<h2 id="Notes" name="Notes">참고</h2>

<p>innerWidth 값은 window, frame, frameset이나 다른 윈도우들처럼 모든 window 형식의 객체에서 사용할 수 있습니다.</p>

<p>There is <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=189112#c7" title="https://bugzilla.mozilla.org/show_bug.cgi?id=189112#c7">an algorithm</a> to obtain the width of the viewport excluding, if rendered, the vertical scrollbar.</p>

<h2 id="예제">예제</h2>

<pre class="brush: js">// 다음과 같이 뷰포트의 폭을 받아올 수 있습니다.
var intFrameWidth = window.innerWidth;

// 다음과 같이 frameset 안의 어떤 frame의 뷰포트 폭을 받아올 수 있습니다.
var intFrameWidth = self.innerWidth;

// 다음과 같이 가장 가까운 frameset의 뷰포트 폭을 받아올 수 있습니다.
var intFramesetWidth = parent.innerWidth;

// 다음과 같이 가장 바깥쪽 프레임셋의 뷰포트 폭을 받아올 수 있습니다.
var intOuterFramesetWidth = top.innerWidth;</pre>

<p>윈도우의 사이즈를 변경하려면, {{domxref("window.resizeBy")}} 또는 {{domxref("window.resizeTo")}}를 참조하세요.</p>

<h2 id="Standards_information" name="Standards_information">명세</h2>

<p> </p>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSSOM View', '#dom-window-innerwidth', 'window.innerWidth')}}</td>
   <td>{{Spec2('CSSOM View')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>

<p>{{Compat("api.Window.innerWidth")}}</p>

<h2 id="참고_자료">참고 자료</h2>

<ul>
 <li>{{domxref("window.outerWidth")}}</li>
 <li>{{domxref("window.innerHeight")}}</li>
 <li>{{domxref("window.outerHeight")}}</li>
</ul>