Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Touchstart vs Click. What happens under the hood?

Tags:

First, excuse me please, this is not a programming question, but I think it wont fit to Theoretical CS, and CS Non Programming is still in private Beta.

after updating my phonegap Applications to listen to

$(selector).bind("touchstart",function());

instead of

$(selector).click(function());

(here with jquery),and the performance improved remarkably, I want to know what touchstart does different, despite of the fact that it is probably designed especially for mobile devices environments. I looked up the w3c document on touchstart, but it doesnt provide any information.

if anyone has a link to further explanation or can explain how it works, I greatly appreciate it

like image 457
最白目 Avatar asked Mar 09 '12 11:03

最白目


People also ask

What is Touchstart click?

The touchstart event occurs when the user touches an element. But a click event is fired when the user clicks an element. Usually, both the touchstart and click events are fired in the very same click in the touch and click enabled devices.

What is the counterpart to the Touchstart event?

Definition and Usage Tip: Other events related to the touchstart event are: touchend - occurs when the user removes the finger from an element. touchmove - occurs when the user moves the finger across the screen. touchcancel - occurs when the touch is interrupted.


1 Answers

On the iPhone the touchstart event fires as soon as your finger touches the screen, whereas the click event fires 300 ms after you touch the screen and lift you finger off the screen. The 300 ms time delay is so that Safari can wait to see if you intend to double tap the screen in succession to simulate the zoom gesture.

like image 78
Kernel James Avatar answered Sep 30 '22 00:09

Kernel James