[orientationchange] 디바이스 방향 바뀌는 것 감지 🔁
orientationchange
1
2
3
screen.addEventListener("orientationchange", function () {
alert("the orientation of the device is now " + window.orientation);
});
screen.orientation
이 아닌 window.orientation
사용
세로모드 : window.orientation = 0
가로모드 : window.orientation = 90 || -90
This post is licensed under CC BY 4.0 by the author.