Posted By

vagrantradio on 03/30/11


Tagged

mobile


Versions (?)

Hide Mobile URL Bar On Load


 / Published in: jQuery
 

URL: http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/

Hide the url bar on page load in webkit mobile browsers.

  1. jQuery(window).load(function() {
  2. /mobile/i.test(navigator.userAgent) && document.documentElement.scrollTop === 0 && !pageYOffset && !location.hash && setTimeout(function () {
  3. window.scrollTo(0, 1);
  4. }, 1000);
  5. });

Report this snippet  

You need to login to post a comment.