Jasper
Jasper

Reputation: 5238

touchstart vs touchbegin events

What is the right choice for targeting the touch events on mobile devices?

There's no a single word about touchbegin at https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Touch_events, while I've seen many plugins that use touchbegin event instead of touchstart.

What is the difference between them?

Upvotes: 0

Views: 831

Answers (2)

James Donnelly
James Donnelly

Reputation: 128836

There is no touchbegin event native in JavaScript. If plugins are using touchbegin they must be defining it themselves.

touchstart on the other hand is native to JavaScript, and if you're wanting to track touch events this is what you'd use.

Upvotes: 1

Jai
Jai

Reputation: 74738

touchstart:

When a touchstart event occurs, indicating that a new touch on the surface has occurred.


This is (touchstart, touchend, etc.) are available at the front end and you can control it via javascript/jQuery.


touchbegin:

Where i got it is an event in the objective-c and you can't track/controll it on frontend.

Upvotes: 1

Related Questions