Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Detect if element is animated with css3? Reply To: Detect if element is animated with css3?

#167738
__
Participant

Well, the most “oldschool” way would be to set a var as a “flag” to track when the transition is in progress, and only toggle the class if it is not. When you toggle the class name, make this transitioning status flag true. You can listen for the transitionend event (using jQuery’s one() method, just like in the example @Paulie_D linked to), and set the flag back to false when the transition is done.

example