I need to execute some JavaScript logic every time a mobile device switches from portrait to landscape orientation. I'm using the following check to accomplish this:
var doOnOrientationChange = function() {
if (window.innerWidth > window.innerHeight) {
// Execute logic for users who are switching to landscape mode
}
};
This works for all iPhone and Android browsers, but it fails for IE10 on Windows Phone 8. Sometimes when IE10 users tap on an input, the logic for landscape mode triggers.
Why does IE10 perceive this action as the user switching to landscape mode?