Hide iPhone address bar on load


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type="application/x-javascript">
  2. if (navigator.userAgent.indexOf('iPhone') != -1) {
  3. addEventListener("load", function() {
  4. setTimeout(hideURLbar, 0);
  5. }, false);
  6. }
  7.  
  8. function hideURLbar() {
  9. window.scrollTo(0, 1);
  10. }
  11. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.