Hacker News new | past | comments | ask | show | jobs | submit login

Many mobile browsers have a ~300ms mobile touch delay unless you disable zooming (because they wait to see if it's a double-tap zoom event). iOS is the biggest issue with this now, as I think Chrome on android better listens to some new directives to not wait



I think with iOS, even if you disable zooming, you still get that 300ms delay. A better solution would be to instead of listening to only click, listen to both click and doing interesting things with ontouchend. I recall implementing something like that a while ago, where when an element is touched (ontouchstart), I saved the X and Y coords of the touch, and when the user releases their finger (ontouchend), if the finger hasn't moved more than say 32 pixels, I fired the callback to whatever. Of course, you also need to do something to prevent triggering the event twice, but when done correctly, you get both nice quick click events and zooming.


Yep, I think there's a well-known library (or 5) around for this somewhere.

edit: https://github.com/ftlabs/fastclick




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: