HTML files load from top to bottom. So if you have a script at the top it will load before the rest of your page. If your javascript code is manipulating any of the page elements, it will look like the code hasn’t worked because the elements haven’t been loaded yet!
It also makes the page load faster for the user if the javascript is at the bottom.
I’ve edited it, but it still doesn’t work. If you back to the github link, I’ve written where the site would be. The nav bar that is supposed to slide down when a user hovers over it is supposed to be hidden with jquery. It isn’t working because the slider nav bar isn’t hidden.
Make sure <script src="script.js" type="text/javascript"></script> appears after the jQuery script element or it will not work. Any libraries dependent on the code you write in script.js (in this case jQuery) must be loaded first.
I used the click one for if the site is being viewed on a phone and when you click on one of the links (if you are on a computer), the bar gets hidden.