1

I have an html5 game rendered on a canvas. I've added "click" handlers on the canvas. Here's its html:

<canvas id="game" width="640" height="480" onclick="void(0)"></canvas>

The problem is, every time I click on the canvas, there seems to be a delay of .5-1 seconds before it reacts which is really noticeable. When I test my game out on my desktop, there is no delay at all so it has something to do with iPad/iOS. This is not a performance issue because my game reacts to swipe events immediately.

As I have very little experience developing on this hardware, I don't really know how to debug this or even give more useful information than I am. I'm just hoping someone out there may know something I don't. As a hypothetical: "iOS click events have a default 500ms delay on them. You can change this default by doing x".

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
  • I actually do believe there's something on iOS having to do with the double-click-zoom feature. That it will wait to make sure there is *not* a double-click before sending the click event. I also think there's a way to disable it but I don't remember exactly right now – lc. Sep 28 '13 at 02:22
  • 1
    Look [here](http://stackoverflow.com/a/12417114/31158) – Jordão Sep 28 '13 at 02:33
  • @Jordão that was the answer, thanks – Daniel Kaplan Sep 28 '13 at 02:45
  • 1
    possible duplicate of [Eliminate 300ms delay on click events in mobile Safari](http://stackoverflow.com/questions/12238587/eliminate-300ms-delay-on-click-events-in-mobile-safari) – nkron Sep 28 '13 at 05:24

0 Answers0