HI there,
I am following this website to add jquery to my site but its not working.
HI there,
I am following this website to add jquery to my site but its not working.
put the code from your file on http://pastie.org so we can view it. We also need to know:
- which theme are you using?
- provide a link to your site
the tutorial above should work just fine.
The theme that i am using is a cosmetic upgrade from 2.9 default.
The code i am using is the one from the website.
And the link: http://bit.ly/aM06Hj
Ive added the code and HTML example from the example website
If the first tutorial with jQuery(document).ready isn't work for you try this way. Also make sure jquery is before your jquary scripts.
I have been doing this before 3.0 and on 3.0 fine.
<script type="text/javascript">
var $j = jQuery.noConflict();
// Use jQuery via $j(...) instead of $(..)
$j(document).ready(function(){
...
});
</script>
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
ah yes tried than no conflict at that was a problem before 3.0. Seems that you can use $ with this system ok. For some reason i tried adding Googles CDN for jquery and it works fine now. Calling the library with en_queue didnt work but all woking now. Although my jQuery is performing weird inside WordPress:
$(document).ready(function(){
$("li.linknames").each(function() {
//add variable for loacting the link
var target = $(this).find("a").attr("href");
$(this).click(function() {
$(target).show("fast"); $("a.close").click(function() {
$(this).parent().hide("fast")
return false;
});
});
});
Only the close btn hides but i have called the parent. It works outside of WordPress. Can you see anything? :-0
anyone?
This topic has been closed to new replies.