-
-
Save umaar/2860628 to your computer and use it in GitHub Desktop.
Hide URL Bar for iOS and Android based on html5 mobile boilerplate
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
// Hide URL Bar for iOS and Android "level above next level" | |
// streamlined version without extension part | |
// slowly moving it to perfection... | |
MBP.hideUrlBar = function () { | |
if ( !location.hash ) { | |
doScrollTop = setInterval(function(){ | |
if( document.body && !( ( pageYOffset || document.body.scrollTop ) > 20 ) ){ | |
clearInterval( doScrollTop ); | |
scrollTo( 0,1 ); | |
pageYOffset = 0; | |
scrollTo( 0, ( pageYOffset === document.body.scrollTop ) ? 1 : 0 ); | |
} | |
}, 200 ); | |
} | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment