Using jQuery to Detect When CSS3 Animations and Transitions End

var myButton = $('#button'), myBox = $('#box'); myButton.click(function () { myBox.addClass('change-size'); myBox.one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(e) { /* code to execute after animation ends i.e. the callback */ myBox.removeClass('change-size'); }); });
This is an example of a callback function for a CSS3 Animation.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.