now I am working on a game landing page with a 1200-high picture in the background, which is not high enough to fill the screen when placed on the phone. I hope to be able to force the horizontal screen when the phone is turned on.
method I found:
/ / determine screen orientation
if (window.orientation==90 | | window.orientation==-90) {
alert("")
}
/ / listen for screen orientation
window.onorientationchange = function () {
switch(window.orientation){
case -90:
case 90:
alert(":" + window.orientation);
case 0:
case 180:
alert(":" + window.orientation);
break;
}
}
but after testing, I found that window.orientation has been abandoned. Is there any other way to do it?