Skip to content

Instantly share code, notes, and snippets.

@ryanpcmcquen
Forked from LeaVerou/dabblet.css
Created September 6, 2014 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanpcmcquen/d807aac7105030579230 to your computer and use it in GitHub Desktop.
Save ryanpcmcquen/d807aac7105030579230 to your computer and use it in GitHub Desktop.
Animation on hover (right way)
/**
* Animation on hover (right way)
*/
div {
width: 9em;
padding: .6em 1em;
margin: 2em auto;
background: yellowgreen;
animation: spin 1s linear infinite;
animation-play-state: paused;
}
@keyframes spin {
to {
transform: rotate(1turn);
}
}
div:hover {
animation-play-state: running;
}
<div ontouchstart="">Hover over me and watch me spin!</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment