Home › Forums › JavaScript › Detect if element is animated with css3? › Reply To: Detect if element is animated with css3?
April 6, 2014 at 10:56 am
#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.