I'm using this condition to detect portrait or landscape of ios devices. But it's not working. What might be the problem?
if (navigator.standalone) {
var windowHeight = $(window).height();
var windowWidth = $(window).width();
if(windowWidth>windowHeight) {
$('body').css('border','0');
}else{
$('body').css('border-top','20px solid #c23c2f');
}
}
The (windowWidth>windowHeight) seems to be not working, since, it only works on the first load of the page, if the user uses landscape as default, then when tilted to portrait, the condition is not met.