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

前端 未结 11 2274
一生所求
一生所求 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:35

    my solution was to remove the :hover state from the css, and when you think about it, mobile browsers should not have :hover state, since there is no hover..

    if you want to keep the hover state on desktop, you can use media query, like so:

    .button {
        background: '#000'
    }
    
    @media (min-width: 992px) {
        .button:hover {
            background: '#fff'
        }
    }
    

提交回复
热议问题