Question

Building a site with jQuery and jGestures and have noticed some devices such as iPads won't respond to the on 'click' event instead they respond to 'tapone'.

I replaced all instances of 'click' with 'tapone' and after testing in various browsers I have noticed no issues. Browsers include the latest versions of IE, Firefox, Chrome for Windows and Safari on Ipad 4.

What are the drawbacks to replacing all instances of: on('click', .... with: on('tapone', ... Will this cause issues with any desktop browsers?

Was it helpful?

Solution

click is the native browser event.

tapone is a custom event triggered by the jGestures library to capture a one-finger tap. (It also has taptwo etc for multi-touch taps.)

If you are using the library, use its events. Seems like it normalizes to click on non-touch browsers which is why you don't see any issues.

From the documentation:

On every native touchstart, touchend, gesturestart and gestureend-event, jgestures triggers a corresponding custom event (jGestures.touchstart,jGestures.touchend,jGestures.gesturestart and jGestures.gestureend) on the event-element.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top