I get the error shown below (73TypeError) on a small background animation script when included in the header of a WordPress theme, which breaks the script. I don’t see any error when the script is included on non-Wordpress page:

Here is the script:
$(function() {
$(".bottom").hover( function () {
$(this).animate( {
backgroundPosition : '0px 35px'}
, 300); }
, function () {
$(this).animate( {
backgroundPosition : '0px 0px'}
, 600); }
);
}
);
Could someone advise at what is causing this error?
Thanks,
Nick
Fist off in wordpress, jQuery should be loaded with no-COnflict. So in this case your file should be;
and secondly, like undefined mentioned, you need to load your jQuery using
wp-enqueue-script();To accomplish this, for best practices, place your jQuery on a separate file. call it for example bganimation.js
now to load that js file in wordpress, use wp-enqueue-script(); like this.
hope this helps.