javascript orientationchange code example
Example 1: how to execute javascript cde on window rotate
window.addEventListener("orientationchange", function(event) {
console.log("the orientation of the device is now " + event.target.screen.orientation.angle);
});
Example 2: screen rotation in css
@media screen and (orientation:portrait) { … }
@media screen and (orientation:landscape) { … }