Question

is there a way to capture an orientation change event in Windows phone 7 in the browser?

in Android and iOS there is the onOrientationchange() event - but in Windows mobile IE9 (Windows phone 7) it just don't work...

Was it helpful?

Solution

Unfortunately it doesn't look like you can. You could use some javascript to detect changes to the screen width though to emulate similar behaviour

OTHER TIPS

if (navigator.userAgent.match(/Windows Phone/i)) { window.onresize = function (event) { ... } }

window.onorientationchange = function () { ... }

You could use a window.resize event as suggested by @Assaf, and detect the orientation with window.styleMedia.matchMedium("(orientation: landscape)");

matchMedium, is the non-standard Webkit precursor of HTML5 matchMedia supported in IE9.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top