Is it possible to get a notification (like callback) when a CSS transition has been completed?
I know that Safari implements a webkitTransitionEnd callback that you can attach directly to the element with the transition. Their example (reformatted to multiple lines):
|
|||||||||||||||||
|
Yes, if such things are supported by the browser, then an event is triggered when the transition completes. The actual event however, differs between browsers:
However you should be aware that With this in mind, I tend to use this event in a chunk of code that looks a bit like this:
Note: to get the transition event end name you can use the method posted as the answer in: How do I normalize CSS3 Transition functions across browsers?. Note: this question is also related to: - CSS3 transition events |
||||
|
I am using the following code, is much simpler than trying to detect which specific end event a browser uses.
|
|||
|
The jQuery.transit plugin, a plugin for CSS3 transformations and transitions, can call your CSS animations from script and give you a callback. |
||||
|