aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/screen/orientation/index.html
blob: 44d0ee2830f7ba71762b12516af764b5ddbdf940 (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
---
title: Screen.orientation
slug: Web/API/Screen/orientation
translation_of: Web/API/Screen/orientation
---
<p>{{APIRef("CSSOM View")}} {{SeeCompatTable}}</p>

<h2 id="Summary">Summary</h2>

<p><code>orientation</code> 속성은 화면의 현재 방향을 알려 준다.</p>

<div class="note">
<p><strong>Note:</strong> 이 함수는 설치된 웹앱 또는 <a href="/ko/docs/Web/Guide/DOM/Using_full_screen_mode" style="line-height: 1.5em;" title="/ko/docs/Web/Guide/DOM/Using_full_screen_mode">full-screen mode</a> <span style="line-height: 1.5em;">의 웹페이지에서 동작한다.</span></p>
</div>

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

<pre class="eval">var orientation = window.screen.orientation;
</pre>

<h2 id="Example" name="Example">Return value</h2>

<p>리턴값은 화면의 방향을 표현하는 문자열이다. portrait-primary, portrait-secondary, landscape-primary, landscape-secondary 가 될 수 있다. (각 값들에 대해 좀 더 많은 정보를 구하려면 {{domxref("window.screen.lockOrientation","lockOrientation")}} 를 보라.).</p>

<h2 id="Example" name="Example">Example</h2>

<pre class="brush: js">var orientation = screen.mozOrientation;

if (orientation === "landscape-primary") {
  console.log("That looks good.");
} else if (orientation === "landscape-secondary") {
  console.log("Mmmh... the screen is upside down!");
} else if (orientation === "portrait-secondary" || orientation === "portrait-secondary") {
  console.log("Mmmh... you should rotate your device");
}
</pre>

<h2 id="Specifications" name="Specifications">Specifications</h2>

<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('Screen Orientation', '', 'Screen Orientation') }}</td>
   <td>{{ Spec2('Screen Orientation') }}</td>
   <td>Draft specification</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.Screen.orientation")}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{domxref("window.screen.orientation")}}</li>
 <li>{{domxref("window.screen.unlockOrientation()")}}</li>
 <li>{{domxref("window.screen.onorientationchange")}}</li>
 <li><a href="/ko/docs/Managing_screen_orientation" title="/ko/docs/Managing_screen_orientation">Managing screen orientation</a></li>
</ul>