benjamincharity
2/16/2013 - 4:16 PM

Remy Sharp's solution to hiding the mobile nav bar without affecting desktop browsers.

Remy Sharp's solution to hiding the mobile nav bar without affecting desktop browsers.

// Original Author: Remy Sharp - http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/

/mobi/i.test(navigator.userAgent) && !location.hash && setTimeout(function () {
  if (!pageYOffset) window.scrollTo(0, 1);
}, 1000);