This question has already been answered:
- Time to finalize CSS 2 response properties
I add an element to the class for which the animation is set. After adding the animation does not want to turn on. Enabled only if you add a class via setTimeout . Here is an example: http://jsfiddle.net/8vqg8gh8/
jQuery('.b').on('click', function() { var element = jQuery('.a'); element.removeClass('a'); element.addClass('a'); }); @keyframes anim { 0% {width: 0px; height: 0px;} 100% {width: 100px; height: 100px;} } .a { width: 100px; height: 100px; border: 1px solid black; animation: anim 0.5s; } .b { cursor: pointer; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class = "a"></div> <span class = "b">Перезапустить</span>