Custom theme dropdown menu not working
-
Hi everyone!
I’ve built a custom theme for my blog and I can’t get my dropdown menu working. I followed a tutorial using javascript, but I don’t know javascript very well. I think there is something wrong with this code, but I don’t know how to fix it:
<script type="text/javascript"> (function() { $("#navigation ul.menu ul").css({ display: 'none' }); $("#navigation ul.menu li").hover(function() { $(this).find('ul.sub-menu') .stop(true, true).delay(10).animate({ "height": "show", "opacity": "show" }, 200 ); }, function(){ $(this).find('ul.sub-menu') .stop(true, true).delay(10).animate({ "height": "hide", "opacity": "hide" }, 200 ); }); }); </script>Any help would be greatly appreciated! I want to be able to make my menus in the wordpress menus function and have the second level navigation actually work!
xxMillie
-
Which tutorial are you following?
Also see http://codex.wordpress.org/Using_JavascriptI copied/pasted it all in ages ago and was a loser and didn’t bookmark where I got it from, so I don’t remember. The javascript I posted above is in the header.php file before </head> The script itself didn’t come in a file so linking it in isn’t possible and at this stage javascript is still completely over my head…
A reason why it’s not working is that it’s set to run ASAP, before any page elements are loaded.
Other reasons could be that it’s not using noconflict wrappers or being enqueued.
Thank you so much! It wasn’t using noconflict wrappers!! Now to code it to display better! I’ve been stuck on this for ages, thank you so much for your help!
The topic ‘Custom theme dropdown menu not working’ is closed to new replies.