ScreenOrientation
Screen Orientation API の ScreenOrientation
インターフェイスは、文書の現在の向きの情報を提供します。
ScreenOrientation
オブジェクトのインスタンスは、screen.orientation
プロパティで取得できます。
インスタンスプロパティ
ScreenOrientation.type
読取専用-
文書の現在の向きのタイプを返します。
"portrait-primary"
、"portrait-secondary"
、"landscape-primary"
、"landscape-secondary"
のいずれかです。 ScreenOrientation.angle
読取専用-
文書の現在の向きの角度を返します。
イベントハンドラー
ScreenOrientation.onchange
(en-US)-
画面の向きが変わるたびに呼ばれるイベントハンドラーです。
インスタンスメソッド
ScreenOrientation.lock()
-
含んでいる文書の向きをデフォルトの向きに固定し、
Promise
を返します。 ScreenOrientation.unlock()
-
含んでいる文書の向きのデフォルトの向きへの固定を解除します。
仕様書
Specification |
---|
Screen Orientation # screenorientation-interface |
ブラウザーの互換性
BCD tables only load in the browser