Sometimes, we want to force landscape orientation mode with JavaScript.
In this article, we’ll look at how to force landscape orientation mode with JavaScript.
How to force landscape orientation mode with JavaScript?
To force landscape orientation mode with JavaScript, we can use the screen.orientation.lock method.
For instance, we write
screen.orientation.lock("landscape");
to call screen.orientation.lock to lock the screen to landscape mode.
Conclusion
To force landscape orientation mode with JavaScript, we can use the screen.orientation.lock method.