Screen real estate is precious, right? Screen is small, etc. You may have noticed that when you scroll, the toolbars (address bar and the debug console) disappear.
Wouldn’t it be nice if you can remove the toolbars right away when the page loads, without the need for the user to do the scroll exercise? Yep, and it’s a very easy trick and I’m using it on this blog. If you read from your iPhone, you might have already noticed it. So what’s the trick? Just use JavaScript to scroll by one pixel. Clever, eh?
And here’s the mega-complicated code to do so:
window.addEventListener( ‘load‘, function(){ setTimeout(scrollTo, 0, 0, 1); }, false );
Note that you need to have enough content so that the page is scrollable. If you don’t (like in my example above, just set the height of the page using the viewport meta tag)
[...] here are the dimensions measured before and after the toolbar hiding trick and with/without the debug console toolbar. Also portrait and [...]