0

Is there a way in javascript to detect if there is currently a css3 transition running?

Ideally a 'transitionstart' event would be useful, then I could catch all transitionstart events and wait for the corresponding transitionend events.

My scenario is the following. I would like to add an 'active' class to a dom element that will potentially trigger transitions on that element and also any number of child elements. I would like a callback once all animations are completed, and ideally I would like to keep all the animation timings in css and not javascript.

6
  • Is there anything triggering this transition? Commented Jul 11, 2013 at 10:33
  • adding a class to the element / a parent element Commented Jul 11, 2013 at 10:37
  • Possible duplicate: stackoverflow.com/questions/7264899/… and stackoverflow.com/questions/2794148/css3-transition-events Commented Jul 11, 2013 at 10:55
  • neither of these directly answer the question asked. The first describes detection of css3 transition capability and the second describes how to attach handlers to the end of transitions. The question here is detecting if there are any transitions currently in progress, without having to know know what elements have tranisitions on and when they are initiated Commented Jul 11, 2013 at 16:40
  • Why not use the same function that sets the class that triggers the transition as the trigger ? Commented Jul 12, 2013 at 2:09

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.