iPad jQuery live click events not working?

Recently when working on a web app for a client, I noticed that any click events added to a non-anchor element didn’t work on the iPad or iPhone.  All desktop and other mobile devices worked fine – but as the Apple products are the most popular mobile devices, it was important to get it fixed.

Turns out that any non-anchor element assigned a click handler in jQuery must either have an onClick attribute (can be empty like below):

onClick=""

OR

The element css needs to have the following declaration:

cursor:pointer

Strange, but that’s what it took to get things working again!

暂无评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: