Skip to content

Instantly share code, notes, and snippets.

@dommmel
Created September 13, 2013 11:14
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 dommmel/6549388 to your computer and use it in GitHub Desktop.
Save dommmel/6549388 to your computer and use it in GitHub Desktop.
Hide adress bar on iphone/android
// Hide adress bar on iphone/android
$(function() {
function hideURLbar() {
if (window.location.hash.indexOf('#') == -1) {
window.scrollTo(0, 1);
}
};
if (navigator.userAgent.indexOf('iPhone') != -1 || navigator.userAgent.indexOf('Android') != -1) {
addEventListener("load", function() {
setTimeout(hideURLbar, 0);
}, false);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment