• For some reason I just can’t get jQuery to work on my WordPress 3.5.1-site. I’ve had this problem before too, but have no idea how, or even if I solved it.

    I’ve read the guides, the tutorials, but nothing seem to work for me. Nothing takes effect.

    Can someone step by step guide me where to put and how to get a toggle-script running?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    What is the code you are using? If it is more than 10 lines of code use pastebin.com or similar to post it. 🙂

    Thread Starter tkse

    (@tkse)

    HTML:

    <div id="phone-dd">
    			<a href="#">Nav</a>
    	</div>
    	<div id="phone-menu">
    		<ul>
    			<li><a href="#">Example</a></li>
    		</ul>
    	</div>

    jQuery:

    jQuery('#phone-dd').click(function() {
      jQuery('#phone-menu').toggle('slow', function() {
        // Animation complete.
      });
    });

    …nothing happens.

    I’ve tried simply putting the jQuery in a script-tag, I’ve tried guides including wp_enqueue_script among others.

    Thread Starter tkse

    (@tkse)

    Update:

    I found the problem. The get_template_directory_uri() in my functions.php got the twentytwelve-path. So instead of /mytheme/js/myjs.js, I got /twentytwelve/js/myjs.js.

    Solved it by writing the path manually. As long as that doesn’t create any problems I have a solution for now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Just a little jQuery script :(’ is closed to new replies.