Created
June 22, 2014 20:14
-
-
Save terrencewood/c0979346552bd2b1608d to your computer and use it in GitHub Desktop.
iOS minimal-ui orientation change fix
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, minimal-ui"> | |
| <title>Title</title> | |
| <style> | |
| body { | |
| -webkit-text-size-adjust: 100%; | |
| position: absolute; | |
| top: 0; | |
| right: 0; | |
| bottom: 0; | |
| left: 0; | |
| } | |
| .wrapper { | |
| overflow-y: scroll; | |
| -webkit-overflow-scrolling: touch; | |
| } | |
| </style> | |
| <script> | |
| window.addEventListener("orientationchange", function() { | |
| window.scrollTo(0,0); | |
| }); | |
| </script> | |
| </head> | |
| <body> | |
| <div class="wrapper"> | |
| <div><!-- this section scrolls --></div> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment