Skip to content

Instantly share code, notes, and snippets.

@JulesNeck
Created October 2, 2011 13:37
Show Gist options
  • Select an option

  • Save JulesNeck/1257461 to your computer and use it in GitHub Desktop.

Select an option

Save JulesNeck/1257461 to your computer and use it in GitHub Desktop.
Hide URL Bar for iOS and Android based on html5 mobile boilerplate
// 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 );
}
};
@JulesNeck
Copy link
Copy Markdown
Author

JulesNeck commented Oct 4, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment