davidaurelio / TouchScroll

TouchScroll is a JavaScript- and CSS 3-based scroller for devices using Webkit Mobile. It is meant to mimic “native” scrolling feeling and behavior as much as possible.
http://uxebu.com/blog/2010/04/27/touchscroll-a-scrolling-layer-for-webkit-mobile/
BSD 2-Clause "Simplified" License
474 stars 61 forks source link

hide URL bar does not work with TouchScroll demo #5

Open rsaccon opened 14 years ago

rsaccon commented 14 years ago

I have tried to add URL Bar hiding at load on orientation change events. But it does not work. I did not find hard-coded "height" dimensions as possible reasons. The approach choosen to hide the URL bar is a delayed window.scrollTo :

setTimeout(function() { window.scrollTo(0, 1); }, 100);

davidaurelio commented 14 years ago

Hey rsaccon. I think hiding the scrollbar is out of the scope of the demo. The purpose is to show the scroller and how to do a layout using display: -webkit-box. Is there any reason why the demo should hide the urlbar?

rsaccon commented 14 years ago

Of course there is no need to hide the scrollbar specific for this demo. However the question is why does the standard approach for hiding iPhone URL bar NOT work here ?

davidaurelio commented 14 years ago

Ok, now I understand better. Just how you assumed, there is no explicit height. I used height: 100% for html, body, #chrome, #demo. However, the window.scrollTo()-technique needs the contents to be bigger than the viewport. Maybe adding #body { margin-bottom: 41px } would be sufficient …

rsaccon commented 14 years ago

I tried with: body { margin-bottom: 60px }, now UrlBar hides, but .scroller does not resize to increased height, seems to be tricky to get it right ...

davidaurelio commented 14 years ago

I’ll have a look at it, because I think I will need this myself one day …

chrisdrackett commented 13 years ago

Yeah, I'm running into the same thing. We'll let you guys know if we find a solution

davidaurelio commented 13 years ago

Cool, thank you. I’ll solve the other issues popping up here first.