Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix the jQuery 1.8 “unsupported pseudo” error?

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?

like image 240
Mathias Bynens Avatar asked Dec 14 '25 16:12

Mathias Bynens


1 Answers

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.

like image 71
Mathias Bynens Avatar answered Dec 16 '25 09:12

Mathias Bynens



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!