Despite having a similar title, my question is not a duplicate of Prevent orientation change in iOS Safari. I have modified the code provided below.
I have written the following code to automatically rotate the content when a user rotates their iPad/iPhone/iPod, forcing them to rotate the device to view the content correctly.
if(window.orientation==90)
{
document.getElementById("orient").style.webkitTransform="rotate("+window.orientation+"deg)";
document.getElementById("orient").style.webkitTransformOrigin="0px 0px";
document.getElementById("orient").style.top=screen.height+"px";
}
However, when I rotate my device, the content disappears. Can someone assist me in getting this code to function correctly?