Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pause a WebKit animation on hover

I'm trying to get an animation to pause on mouse over with the following:

.quote:nth-child(1):hover {     -webkit-animation-play-state: paused;     -moz-animation-play-state: paused;     -o-animation-play-state: paused;     animation-play-state: paused; } 

But it does not want to pause. Can anybody see what I'm doing wrong?

JSFIDDLE

like image 266
user2760221 Avatar asked Nov 18 '13 16:11

user2760221


People also ask

How do I stop an animation from hover?

By setting the animation-play-state to paused on hover, the animation will pause, your click targets will stop moving, and your users will be happy.

How do you pause an animation in a keyframe?

Have you ever wonder about how we can pause the animation when it starts? We can use animation-delay property but it will only delay the start of the animation, once the animation starts it will continuously animate. Once the CSS keyframe animation starts, we cannot pause it unless we will use javascript.

How do you stop animation?

To remove more than one animation effect from text or an object, in the Animation Pane, press Ctrl, click each animation effect that you want to remove, and then press Delete. To remove all animation effects from text or an object, click the object that you want to stop animating.


1 Answers

Instead of:

.quote:nth-child(1):hover  {     -webkit-animation-play-state: paused;     -moz-animation-play-state: paused;     -o-animation-play-state: paused;     animation-play-state: paused; } 

use:

.quote-wrapper:hover .quote  {     -webkit-animation-play-state: paused;     -moz-animation-play-state: paused;     -o-animation-play-state: paused;      animation-play-state: paused; } 

DEMO: http://jsfiddle.net/j4Abq/2/

like image 182
tomsullivan1989 Avatar answered Sep 24 '22 16:09

tomsullivan1989