Changing :hover to touch/click for mobile devices

后端 未结 9 1988
余生分开走
余生分开走 2020-11-28 19:43

I\'ve had a look around but can\'t quite find what i\'m looking for.

I currently have a css animation on my page which is triggered by :hover. I would like this to c

9条回答
  •  难免孤独
    2020-11-28 20:20

    If you use :active selector in combination with :hover you can achieve this according to w3schools as long as the :active selector is called after the :hover selector.

     .info-slide:hover, .info-slide:active{
       height:300px;
     }
    

    You'd have to test the FIDDLE in a mobile environment. I can't at the moment.
    correction - I just tested in a mobile, it works fine

提交回复
热议问题