「JavaScript」orientationchangeイベントのサンプル
説明
orientationchange イベントは、端末の向きが変化した時に発生します。
使用例1
window.addEventListener("orientationchange", function() {
console.log("端末向きが変化した時、画面向きを表示" + screen.orientation.angle);
});
使用例2
window.onorientationchange = function(){
console.log("端末向きが変化した時、画面向きを表示" + screen.orientation.angle);
};