jQuery in WordPress
-
I’m trying to put some simple jQuery code into the WordPress header (usually just use CSS) but no matter what I try I cannot seem to get it to work. The code is:
<script type="text/javascript"> var fadein = 300; var fadeout = 200; $(document).ready(function(){ $("#btnforum img, #btnfacebook img, #btntwitter img, #btnyoutube img, #btnlivestream img, #btncontact img").hover(function() { $(this).stop().animate({"opacity": "0"}, fadein); $(this).css('cursor', 'pointer'); }, function() { $(this).stop().animate({"opacity": "1"}, fadeout); }); }); </script>
Not much at all. It works fine in a HTML page. I have done a little reading from the WordPress codex and a few other sources and have tried a few things. Replacing ‘$’ with ‘jquery’, using ‘<?php wp_enqueue_script(“jquery”); ?>’ and so on – but it still won’t trigger.
Does anyone have any real knowledge of this? I just need to know where to put what specifically in relation to the code I have as what some tutorials are saying do not really make sense to me.
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘jQuery in WordPress’ is closed to new replies.