Search code examples
javascriptvelocity.js

How to check Velocity is animated


In jQuery we have:

.is(':animated')

But this doesn't work for velocity.js.

How to check the element is an animated?


Solution

  • Velocity adds the class velocity-animating to elements that are being animated.

    So you should be able to do it as follows:

    .is('.velocity-animating')
    

    See here and here in the code.

    Couldn't find it in the docs though I remember it was covered.