Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, I get the events on iOS if I turn off touch scrolling, but I don't get the nice, smooth scrolling. I don't know how it works on Android.

However, on iOS, I can't seem to disable the bounce scrolling of the entire screen if I have any scrollable areas on the screen. So I ended up writing a decorator for overflow:auto elements that re-implements touch scrolling. And does a preventDefault() as necessary to prevent the bounce of the app.

Here is a gist of the decorator:

  https://gist.github.com/3086981
and I've updated the original gist to include the ScrollController.

It works on the iPad, but I can't vouch for android. (This code is from a little weekend project.)

Edit: I didn't implement rubber banding or anything. It's just a quick and dirty scroll with some inertia based on a weighted average velocity of the last two touchmove events. It doesn't feel too bad, but it isn't perfect.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: