Stop animation and start transition on hover

前端 未结 6 1375
误落风尘
误落风尘 2021-01-07 19:05

I have a link that\'s running an infinite animation with the background color. I want to stop the animation and transition into a different background color on hover.

<
6条回答
  •  粉色の甜心
    2021-01-07 19:23

    I have the same issue and the solution I found is the following.

    Create the animation you want and for the element you and to each assign each one a different class.

    Then use .mouseover() or .mouseenter() jQuery events toggle between the classes you assigned to each animation.

    It is similar to what you use for a burger menu, just with a different handler.

提交回复
热议问题