DOM
:インターフェイス
:ScreenOrientation インターフェイス
編集:2022.04.08 by T.A.
→● MS(en-US)
Screen Orientation API の ScreenOrientation インターフェイスは、ドキュメントの現在の向きに関する情報を提供します。
ScreenOrientation インスタンス オブジェクトは、screen.orientation プロパティを使用して取得できます。
プロパティ
- ScreenOrientation.type 読取専用 ●
- ドキュメントの現在の向きのタイプを返します。「portrait-primary」、「portrait-secondary」、「landscape-primary」、または「landscape-secondary」のいずれかです。
- ScreenOrientation.angle 読取専用 ●
- ドキュメントの現在の向きの角度を返します。
メソッド
- ScreenOrientation.lock() ●
- 含まれているドキュメントの向きをデフォルトの向きにロックし、Promise を返します。
- ScreenOrientation.unlock() ●
- 含まれているドキュメントの向きをデフォルトの向きからロック解除します。
イベントハンドラー
- ScreenOrientation.onchange ●
- 画面の向きが変わるたびに呼び出されるイベントハンドラー。
テスト
ここに表示
|
|
|
|
|
|