On the mobile page, when debugging on chrome, the a tag can execute the click event @ click, but it cannot be clicked after it is placed on the mobile phone.

as mentioned, the z-index setting of a tag is 999, and there is nothing to block it. But the click event is invalid. Excuse me, what is the reason and what is the solution

May.02,2021

solves the problem because my project uses better-scroll, which has its own attribute, click, which defaults to false. Set to true


usually the a tag needs to block the default behavior. In rebound events, you can try whether the default behavior is not blocked on some devices (especially IOS devices will be more obvious). In addition, there is usually a certain delay in the click event on mobile devices, so try to control it through the tap event. tap events are usually controlled by calculating the time difference between touchstart and touchend events.


use the fastclick plug-in


try

Menu