diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/window/orientationchange_event | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/ja/web/api/window/orientationchange_event')
| -rw-r--r-- | files/ja/web/api/window/orientationchange_event/index.html | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/files/ja/web/api/window/orientationchange_event/index.html b/files/ja/web/api/window/orientationchange_event/index.html new file mode 100644 index 0000000000..0302015078 --- /dev/null +++ b/files/ja/web/api/window/orientationchange_event/index.html @@ -0,0 +1,75 @@ +--- +title: 'Window: orientationchange イベント' +slug: Web/API/Window/orientationchange_event +tags: + - API + - Event + - Reference + - Sensors + - Window + - onorientationchange + - イベント +translation_of: Web/API/Window/orientationchange_event +--- +<div>{{APIRef}}</div> + +<p><code>orientationchange</code> イベントは、端末の向きが変化した時に発生します。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">バブリング</th> + <td>なし</td> + </tr> + <tr> + <th scope="row">キャンセル</th> + <td>不可</td> + </tr> + <tr> + <th scope="row">インターフェイス</th> + <td>{{domxref("Event")}}</td> + </tr> + <tr> + <th scope="row">イベントハンドラー</th> + <td>{{domxref("Window/onorientationchange", "onorientationchange")}}</td> + </tr> + </tbody> +</table> + +<h2 id="Example" name="Example">例</h2> + +<p><code>orientationchange</code> イベントは {{domxref("EventTarget/addEventListener", "addEventListener")}} メソッドで使用することができます。</p> + +<pre class="brush:js;">window.addEventListener("orientationchange", function() { + console.log("端末の向きが " + screen.orientation.angle + "になりました。"); +}); +</pre> + +<p>または、 {{domxref("Window/onorientationchange", "onorientationchange")}} イベントハンドラープロパティを使用します。</p> + +<pre class="brush: js">window.onorientationchange = function() { + console.log("端末の向きが " + screen.orientation.angle + "になりました。"); +};</pre> + +<h2 id="Specifications" name="Specifications">仕様書</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Compat', '#event-orientationchange', 'orientationchange')}}</td> + <td>{{Spec2('Compat')}}</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> + +<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div> + +<p>{{Compat("api.Window.orientationchange_event")}}</p> |
