I try to make an animation with webkit-animation and @-webkit-keyframes. I have a div animated with child div inside.
And i would stop the webkit-animation of the parent when my mouse is over a child.
Any Examples ?
Thanks
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.
A @-webkit-keyframes block contains rule sets called keyframes. A keyframe defines the style that will be applied for that moment within the animation. The animation engine will smoothly interpolate style between the keyframes.
What is a CSS hover animation? A CSS hover animation occurs when a user hovers over an element, and the element responds with motion or another transition effect. It's used to highlight key items on a web page and it's an effective way to enhance your site's interactivity. Take a look at the example below.
Unfortunately there is no parent selector in CSS, see here. You will have to use a bit of javascript to select the parent and tell it to pause.
The pause declaration in CSS goes like this:
-webkit-animation-play-state: paused | running;
The javascript (jQuery, in this case) would look something like this:
$(".child").hover(
function(){
$(this).parent().css("-webkit-animation-play-state", "paused");
},
function(){
$(this).parent().css("-webkit-animation-play-state", "running");
});
See a live demo here:
http://jsfiddle.net/UFepV/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With