var supportsOrientationChange = "onorientationchange" in window,
orientationEvent = supportsOrientationChange ? "orientationchange" : "resize";
//adding event listener
window.addEventListener(orientationEvent, function() {
var orientation = window.orientation;
switch(orientation) {
case 0:
//your code goes here.
break;
case 90: //landscapeLeft
case -90: //landscapeRight
//your code goes here.
break;
}
}, false);
Wednesday, October 20, 2010
Subscribe to:
Posts (Atom)