Last active
September 3, 2020 19:39
-
-
Save mynameispj/5234017 to your computer and use it in GitHub Desktop.
jQuery event that fires when the orientation (portrait, landscape) of a mobile device changes
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", function() { | |
alert(window.orientation); | |
//do whatever you want on orientation change here | |
}, false); |
agreed :p
agreed, also keep in mind that you have 3-rd orientation to handle: square
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just came here to say there is no jQuery usage whatsoever in this snippet. I have no idea why you talk about jQuery here.