这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
ScreenOrientation
接口的
Screen Orientation API
provides information about the current orientation of the document.
ScreenOrientation.type
只读
Returns the document's current orientation type, one of "portrait-primary", "portrait-secondary", "landscape-primary", or "landscape-secondary".
ScreenOrientation.angle
只读
Returns the document's current orientation angle.
ScreenOrientation.onchange
EventHandler
called whenever the screen changes orientation.
ScreenOrientation.lock()
Promise
.
ScreenOrientation.unlock()
Unlocks the orientation of the containing document from its default orientation.
| 规范 | 状态 | 注释 |
|---|---|---|
|
Screen Orientation API
The definition of 'ScreenOrientation' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
ScreenOrientation
|
Chrome 38 | Edge 79 | Firefox 43 | IE No | Opera 25 | Safari No | WebView Android 38 | Chrome Android 38 | Firefox Android 43 | Opera Android 25 | Safari iOS No | Samsung Internet Android 3.0 |
angle
|
Chrome 38 | Edge 79 | Firefox 43 | IE No | Opera 25 | Safari No | WebView Android 38 | Chrome Android 38 | Firefox Android 43 | Opera Android 25 | Safari iOS No | Samsung Internet Android 3.0 |
lock
|
Chrome 38 | Edge 79 | Firefox 43 | IE No | Opera 25 | Safari No | WebView Android 38 | Chrome Android 38 | Firefox Android 43 | Opera Android 25 | Safari iOS No | Samsung Internet Android 3.0 |
onchange
|
Chrome 38 | Edge 79 | Firefox 43 | IE No | Opera 25 | Safari No | WebView Android 38 | Chrome Android 38 | Firefox Android 43 | Opera Android 25 | Safari iOS No | Samsung Internet Android 3.0 |
type
|
Chrome 38 | Edge 79 | Firefox 43 | IE No | Opera 25 | Safari No | WebView Android 38 | Chrome Android 38 | Firefox Android 43 | Opera Android 25 | Safari iOS No | Samsung Internet Android 3.0 |
unlock
|
Chrome 38 | Edge 79 | Firefox 43 | IE No | Opera 25 | Safari No | WebView Android 38 | Chrome Android 38 | Firefox Android 43 | Opera Android 25 | Safari iOS No | Samsung Internet Android 3.0 |
完整支持
不支持
ScreenOrientation