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

后端 未结 10 854
感情败类
感情败类 2020-12-01 17:59

I am using jQuery and put this code in my javascript:

function HideMe(itemID) {
    var myDiv = \'item_\' + itemID;
    $(myDiv).fadeOut(\"slow\");
}
         


        
10条回答
  •  温柔的废话
    2020-12-01 18:35

    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).

提交回复
热议问题