A plugin I’m using relies on $(':animated'), but since I upgraded to jQuery 1.8.0 this throws an error:
Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: animated
Did jQuery 1.8.0 drop support for this custom selector as part of its changes in Sizzle? How do I fix this?
Don’t worry, jQuery 1.8.0 still supports the custom $(':animated') selector.
However, contrary to what you might expect, it’s not part of Sizzle (jQuery’s selector engine). If you’re using a custom build, make sure you don’t exclude the effects module, which defines the :animated selector.
For example, if you were creating a custom jQuery build using this command before:
grunt custom:-ajax,-deprecated,-effects
You’ll need to remove the -effects part, like this:
grunt custom:-ajax,-deprecated
Else the :animated selector won’t be supported.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With