Created
March 26, 2015 12:14
-
-
Save plugnburn/dba766c18e7c42b9040c to your computer and use it in GitHub Desktop.
BarBust - a JS hack to hide mobile browser's address bar on load or handheld rotation
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
if('addEventListener'in self && 'pageYOffset'in self && !location.hash.substr(1)) { | |
(function(c){ | |
self.addEventListener('DOMContentLoaded',c,!1); | |
self.addEventListener('orientationchange',c,!1) | |
})(function(){ | |
setTimeout(function(P){ | |
P=self.pageYOffset; | |
self.scrollTo(0,1); | |
if(self.pageYOffset) self.scrollTo(0,0); | |
if(P>20) self.scrollTo(0,P) | |
},1) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment