We are trying to make use of the JQuery that gets automatically loaded by WordPress but our attempts to use the $ alias fails anywhere outside of the document.ready() function. Below are the main points:
WordPress loads JQuery in its template header file. The jquery.js file that WordPress includes contains jQuery.noConflict(); at the very end of it.
In our document.ready() function, we are able to use $ but ONLY within the document.ready() function itself.
Below is a basic
// call a function that tries to use JQuery $
The function TurnOffMouseWheel() is contained in another js file we include (called commonfunctions.js). Below is the code for the TurnOffMouseWheel() function contained in commonfunctions.js:
}); // bind
}); // each
We've tried googling a solution and thought we had followed the correct steps but it's still not working.
Are we missing something basic?