If you just want to animate the background position on hover, it's much easier to use a transition instead of animating keyframes. See this script for an example: http://jsfiddle.net/hfXSs/
If you want to make additional efforts to create an animation, you will need to set the animation state in the div to βpausedβ and change it to βrunningβ on hover. See the animation pause specification here: http://dev.w3.org/csswg/css3-animations/#the-animation-play-state-property-
EDIT: I was bored, so here, using the keyframe animation: http://jsfiddle.net/wGRg5/
Obviously, the violin has a problem: if you do not hover over the div, the animation pauses, which is probably not the desired effect.
source share