Parixit
Parixit

Reputation: 3855

iPad takes three touch for JavaScript click event

I have problem with iPad. I use 3 function in JavaScript for anchor tag, onmouseover, onmouseout, onclick.

But when I test it on the iPad then for first touch it trigger onmouseover, and then it takes two another touch for execute onclick event.

That means it take total three touch for click event. Generally it has to take only two touch for it. Why is it so?

Upvotes: 5

Views: 7607

Answers (1)

balexandre
balexandre

Reputation: 75083

To fully support Mobile devices with their Touch Screens you can't use the mouse events... you need to change to touch events

http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/

Another way is to divide the code using a mobile Framework, like jQTouch, jQMobile, etc...

They support Mouse Events and Touch Events right out of the box.

After you make your code support for Touch Events, even Drag and Drop will work nicely

Drag and drop on iPad

Upvotes: 7

Related Questions