Skip to content

Instantly share code, notes, and snippets.

@elliottmangham
Created December 7, 2020 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elliottmangham/f0815354507e45f3e52e1c03f2c6137e to your computer and use it in GitHub Desktop.
Save elliottmangham/f0815354507e45f3e52e1c03f2c6137e to your computer and use it in GitHub Desktop.
JS / Utilities / Force menu pop-up to be 100vh (to get around Chrome/iOS bar)
/**************
* Force menu pop-up to be 100vh (to get around Chrome/iOS bar)
**************/
$( window ).on( 'load', fnRealWindowHeight );
$( window ).on( 'resize', fnRealWindowHeight );
// Test.......
$( window ).on( 'load resize', fnRealWindowHeight );
function fnRealWindowHeight() {
// Update window height
iWindowHeight = $( window ).height();
// Apply height to navigation pop-up
oMobileMainMenu.css( 'height', iWindowHeight + 'px' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment