jQuery in Wordpress doesn't work?
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 '' 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
Is it in the a Post you wrote?
If so it is possible that WordPress strips out characters or adds slashes to characters to make it "safe to store".
If it is ANYWHERE else besides the post, it should work normal
精彩评论