-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
42 lines (27 loc) · 1.04 KB
/
index.md
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
---
title: "Screen: orientationchange event"
short-title: orientationchange
slug: Web/API/Screen/orientationchange_event
page-type: web-api-event
status:
- deprecated
- non-standard
browser-compat: api.Screen.orientationchange_event
---
{{APIRef("Screen Orientation API")}}{{Deprecated_Header}}{{Non-standard_Header}}
The `orientationchange` event fires when the device's orientation has changed.
## Syntax
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.
```js
addEventListener("orientationchange", (event) => {});
onorientationchange = (event) => {};
```
## Event type
A generic {{domxref("Event")}}.
## Specifications
This feature is not part of any specification. It is no longer on track to becoming a standard.
Use the {{domxref("ScreenOrientation.change_event", "ScreenOrientation change event")}} instead.
## Browser compatibility
{{Compat}}
## See also
- [Managing screen orientation](/en-US/docs/Web/API/CSS_Object_Model/Managing_screen_orientation)