Isaac Betesh
Isaac Betesh

Reputation: 3000

Javascript click event performance on mobile devices

When running Javascript code on a mobile device, the response time of every button is very slow. At first I thought the click event handlers in my code were just very inefficient code, until I visited other sites and realized that 1) the delay happens on every site 2) the delay happens before the click event is fired.

The delay is split into two roughly equal (to the naked eye) parts--before the keydown and between keydown and keyup. After keyup, the click event is fired without any visible (to the naked eye) delay.

Is there anything I can do to make the keydown happen faster or last shorter, whether by changing my device's settings or by optimizing some block of javascript code?

Upvotes: 0

Views: 563

Answers (1)

Isaac Betesh
Isaac Betesh

Reputation: 3000

SpikeX's comments on the question eventually led me to Alex Black's google-fastbutton javascript library, which directly solves this issue.

It implements the solution described in the example SpikeX linked to.

Upvotes: 1

Related Questions