Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 548
Parixit Avatar asked Sep 29 '11 12:09

Parixit


1 Answers

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

like image 93
balexandre Avatar answered Sep 26 '22 12:09

balexandre