buley
buley

Reputation: 29208

Is there a way to tell if an element has completed a CSS3 transition?

I'm looking for an event, callback or other way to tell when a CSS3 transition completes.

Is this possible?

Upvotes: 8

Views: 675

Answers (2)

Richard Connamacher
Richard Connamacher

Reputation: 3216

Listen for the transitionend event:

https://developer.mozilla.org/en/CSS/CSS_transitions#Detecting_the_completion_of_a_transition

Since it uses browser prefixes, you'll have to listen to several different versions of that event for different browsers.

Upvotes: 1

Rob W
Rob W

Reputation: 348992

Use the transitionend event. Note that vendor-specific prefixes have to be added.

Upvotes: 5

Related Questions