jQuery in WordPress issue


I am having an issue getting the down arrow to scroll down the page smoothly using jQuery on this Wordpress page:


The scrollto script is an external JS file which I have placed in the “javascripts” folder, and have referenced it in header.php using an absolute URL.

I assume jQuery is already loaded by WordPress, so what do I need to do next?

There is a reference error on the “scrollto.js” in Firebug which says it can’t find jQuery.

Any hep greatly appreciated!


You need to have your link to the scrollto script below the link to the jQuery library. At the moment, it’s above the jQuery link. The browser reads links from top down, so when it’s reading the scrollto file, it gets confused by the references to the library, because it hasn’t seen it yet.

Awesome! I’ve put the scrollto script in the footer and it works perfectly!