HTML CSS examples for CSS Animation:Animation Control
Pause and resume animation
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div {<!-- ww w.j ava2 s . c om--> width: 80px; height: 80px; background-color: gold; } .shake { animation: shake 1.64s cubic-bezier(.36,.07,.19,.97) infinite; transform: translate3d(0, 0, 0); backface-visibility: hidden; perspective: 1000px; } @keyframes shake { 5%, 45% { transform: translate3d(-1px, 0, 0); } 10%, 40% { transform: translate3d(2px, 0, 0); } 15%, 25%, 35% { transform: translate3d(-4px, 0, 0); } 20%, 30% { transform: translate3d(4px, 0, 0); } 50%{ transform: translate3d(0, 0, 0); } } </style> </head> <body> <div class="shake"> </div> </body> </html>