iPad/iPhone hover problem causes the user to double click a link

后端 未结 26 1771
太阳男子
太阳男子 2020-11-27 09:18

I have some websites I built times ago, that use jquery mouse events...I just got an ipad and i noticed that all the mouse over events are translated in clicks...so for inst

26条回答
  •  悲哀的现实
    2020-11-27 09:32

    I had the same problem but not on a touch device. The event triggers every time you click. There is something about event queuing or so.

    However, my solution was like this: On click event (or touch?) you set a timer. If the link is clicked again within X ms, you just return false.

    To set per element timer, you can use $.data().

    This also may fix the @Ferdy problem described above.

提交回复
热议问题