Why is this JQuery error happening? Animate is not a function

It work for me ----> 
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

Example:

<html>
    <title>.....</title>
    <body>
    <!-------------------- scripts --------------------------------->
        <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> <!- use this->

        <script src="js/navbar-fixed.js"></script>
    </body>
</html>

slim version will not support some methods hence include this CDN

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

in your project and then run your code it will work.


It's because of the jQuery version you use. https://code.jquery.com/jquery-3.1.1.slim.min.js

slim version of jQuery does not contain all the original jQuery functions.

You should use a full version. You can download it from here.

It will help to better understand if you read this article from here where at some point in it you will find this statement and I quote:

Slim build

Finally, we’ve added something new to this release. Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. And often it is simpler to use a combination of CSS and class manipulation for all your web animations. Along with the regular version of jQuery that includes the ajax and effects modules, we’re releasing a “slim” version that excludes these modules. All in all, it excludes ajax, effects, and currently deprecated code.