dabblet

Log in My profile Log out
New dabblet
Save Save as new Save anonymously
View gist View full page result LeaVerou
?
/**
 * 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!');
(ABCabc123&@%) (ABCabc123&@%)
Loading…