Why/when do I have to tap twice to trigger click on iOS

前端 未结 11 2258
一生所求
一生所求 2020-12-13 17:49

Ok I feel like I\'m crazy...

I\'m looking at Mobile Safari on iOs 6.0. I can\'t seem to establish any rhyme or reason as to when tapping on an element will trigger

11条回答
  •  失恋的感觉
    2020-12-13 18:40

    The display:none; solution mentioned above works on iOS (not tested on later than 9.3.5), but not on Android.

    A hacky css-only solution is to hide the link below the element using a minus z-index and to bring the link up to a positive z-index on :hover or first-touch (with a small transition delay). I guess one could achieve the same result with css translate instead of z-index. Works on iOS and Android.

    In this way you can display a hover effect on a link on a touch-screen device with the first tap without activating the url until a second tap.

提交回复
热议问题