Why does jQuery throw the error `fadeOut is not a function'?

I had this error because I was using a slim version of jQuery. If you download the full version you should be okay.


Even if the selector didn't return any items in the collection the function call would have worked (not generated this error anyway) if jQuery was loaded correctly. Either there is a conflict in the page, or it didn't load at all. You can try

jQuery(myDiv).fadeOut("slow");

or look into why jQuery hasn't been loaded.

P.S.: don't forget the # in the selector if selecting by id.


Do you have another javascript library on that page? It seems you have the hide function, and the $ defined (prototype, for example, also has an hide function).
If that is the case, try:

jQuery("#item_0").fadeOut("slow");

This will happen if you're using the "slim" version of jQuery. Only the "full" version of jQuery includes animation effects.

Try grabbing the "full" version of jQuery from the jQuery downloads page and including that in your page (or including a full version of jQuery from a CDN from your page).

Tags:

Jquery