I'm trying to alert mobile device users on my site to use their devices in landscape mode. I have an alert pop up but it seems to be getting caught in an infinite loop. How would I go about stopping that loop after the user has clicked ok?
Here is the code:
window.ondeviceorientation = detectIPadOrientation;
function detectIPadOrientation ()
{
if ( orientation == 0 || orientation == 180 ){
alert ('Please use your iPad in landscape mode');
}
}