Categories
Web Development

Use onTouch instead of onClick for quicker reaction to an event

In JQuery, there is included the “tap” event, which reacts with less of a delay to touches on smartphones. Behind the scenes, it’s bound to touchstart or mousedown. Using the aforementioned event is good for apps that are either solely meant for smartphones or ones that are meant to be used on either smartphones or desktop computers (such as websites).

The onClick event still works in all of the same situations, the developers of JQuery have just added this new event to watch in order to make coding more intuitively worded and to cut down on some of the delay times.

Leave a Reply