Make animation play when NOT hovering on something

I would like to run a keyframes animation in CSS when the user does not hover over the element (e.g. the mouse leaves the element). Is there a way to do this?

1 Like
:hover {animation: none}

(it won’t make a smooth transition though)

or do you mean to “trigger” animation when the mouse moved out of the dom?

2 Likes

out of the dom would be nice

1 Like

In that case I think you need to attach animation by JavaScript when the mouse leaves the dom

1 Like

THANKS! That helps so much!

2 Likes