this code is virtually the same as what I'm using on another site and works perfectly yet is not working on another site. If you can highlight where I'm going wrong I would be grateful.
The code as you pasted it above, seems to work fine, I don't think there's anything wrong with it. If it's working on one site, but not another, then I'd say that the site where it's not working has some other code somewhere that's getting in the way.
jQuery
HTML