I am trying to make a small keyframe animation.
When the user hovers on a button, I want the background image to move slightly to the right, then back again. So a little "bounce" movement.
In my first example I used a simple hover in CSS that changed the background position from 91% to 93% which results in movement when hovered.
However when I tried to do something similar, to use a keyframe animation called nextarrow
, the animation doesn't run.
Here is a JSFiddle showing my working example (button-one
) and my non-working example (button-two
)
Where have I gone wrong?
http://jsfiddle.net/franhaselden/Lfmegdn5/
.button-two.next:hover{
-webkit-animation: nextarrow 1s infinite;
-moz-animation: nextarrow 1s infinite;
-o-animation: nextarrow 1s infinite;
animation: nextarrow 1s infinite;
}
@keyframes nextarrow {
0% {
background-position: 91% center;
}
50% {
background-position: 93% center;
}
100% {
background-position: 91% center;
}
}