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
/* | |
This gist will help you maintain your element's height when using vh units (viewport height) | |
on mobile devices despite the browser's navigation bar being shown/hidden or keyboard open/close, | |
preventing unexpected changes to the layout when the viewport resizes. | |
Useful for background cover images with 100vh height. | |
Try this if your page jumps up and down when the navigation bar is hidden and shown. | |
Tested only on mobile Chrome for Android. | |
Comments and improvements are welcome! | |
License: MIT. | |
*/ |