John Doah
John Doah

Reputation: 1999

getting fadeIn is not a function although I did add jQuery to my HTML file

I'm trying to use jQuery's fadeIn and fadeOut method. This is what I have so far:

var fadeMainGrid = function() { 
$("#picturesGrid").fadeIn();
};

This is how I added jQuery to my HTML file:

<body dir="rtl">

  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>


...
...

</body>

but still, when I try to run fadeMainGrid function, I get this error:

Uncaught TypeError: $(...).fadeIn is not a function

Can't understand what this is happening, I never wrote JS nor used jQuery till this project. Searching the web yield nothing, as everything gave me the same error. What's wrong here?

Upvotes: 0

Views: 1137

Answers (1)

Jacob
Jacob

Reputation: 78860

It looks like you're loading the slim bundle, which according to the downloads page:

...excludes the ajax and effects modules.

fadeIn and fadeOut would fall into that category. You may need to replace your jQuery bundle with one containing more capabilities.

Upvotes: 2

Related Questions