Last active
August 29, 2015 14:03
-
-
Save MoritzBuetzer/887296282e3fe4a6d646 to your computer and use it in GitHub Desktop.
orientationchange
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('orientationchange', handleOrientation, false); | |
function handleOrientation() { | |
if (orientation == 0) { | |
//portraitMode | |
} else if (orientation == 90) { | |
//landscapeMode | |
} else if (orientation == -90) { | |
//landscapeMode | |
} else if (orientation == 180) { | |
//portraitMode | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment