最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jquery - iPad takes three touch for JavaScript click event - Stack Overflow

programmeradmin0浏览0评论

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?

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?

Share Improve this question edited Sep 30, 2012 at 17:10 Parixit asked Sep 29, 2011 at 12:53 ParixitParixit 3,8553 gold badges39 silver badges63 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

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./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

发布评论

评论列表(0)

  1. 暂无评论