神秘地,<a> takes 10-15 taps on mobile to function

时间:2017-03-07 15:01:18

标签: javascript android html mobile

I have stumbled across a rather bizarre bug which I haven't got the slightest idea how to fix.

I have the following DOM structure --

<div ...></div>
<div ...></div>
<div ...>
    <a href="javascript: alert('clicked');">
</div>

This code works perfectly on desktop and on the Chrome Mobile emulator.

However, when visiting the page on mobile, I have to frantically tap the button at least 10 times (usually more), and as if by chance, one of these times it works. It's a very annoying bug and it is one I would like to eliminate. (I have tried different browsers.)

Additionally, using $(...).click yields the same result.

Curiously, moving the element out of the div (devtools) and into another one seems to solve the problem.

Appreciate any help...

0 个答案:

没有答案