Answer a
Penetration (Dianchuan) is a common bug that occurs in various browsers on mobile. This may be caused by a delay in the Click event or by event bubbling.
Touch and tap events in common Zepto libraries for mobile Web development are a bit of a bug (Zepto events are tied to document).
Solution Solutions
1, using Fastclick, this can be very perfect to solve the Dianchuan problem.
2. Add Preventdefault to the Touchend event callback and add Pointer-events:none to the next layer.
Answer two
The click on the mobile side is the touch before the trigger is simulated.
The order of the triggers is
Touchstart
Touchmove
Touchend
MouseDown
MouseMove
MouseEnter
Click
In overlapping areas, the masked element binds the click, the masked element binds the touch event, and the touch-masked element is hidden, resulting in penetration, because the click is delayed after touch, and the browser mistakenly considers the click to be triggered on the masked element.
The best solution is to simulate a click event yourself through Touchstart,touchmove,touchend, so that the event will respond more quickly in addition to preventing penetration.
Mobile Touch Dianchuan (penetrating) solution