Created
September 13, 2013 11:14
-
-
Save dommmel/6549388 to your computer and use it in GitHub Desktop.
Hide adress bar on iphone/android
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
// 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