Reputation: 1904
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...
Upvotes: 2
Views: 3541
Reputation: 5257
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.
Upvotes: 1
Reputation: 11
if (navigator.userAgent.match(/Windows Phone/i)) { window.onresize = function (event) { ... } }
window.onorientationchange = function () { ... }
Upvotes: 1
Reputation: 3114
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
Upvotes: 1