Jquery accordion menu won't work in Wordpress

Jquery accordion menu won't work in Wordpress

here is a working example just using static html page

MENUBAR WORKING EXAMPLE

Just need it to wok with wordpress...




Can anyone help me to get this code to work in wordpress?? It uses the following to work...  It is a very simple accordion menu which works great in static HTML, but when I try and use it with wordpress it just doesn't work. I think it may use an older version of Jquery...





  1. function initMenu() {
    $('#menu ul').hide();
    $('#menu li a').click(
    function() {
    $(this).next().slideToggle('normal');
    }
    );
    }
    $(document).ready(function() {initMenu();});







Here is the HTML, which works, the main problem is that it won't work in wordpress (I think it uses an older version of Jquery and wordpress overrides it somehow even though I call for it in the header.php.

  1. <ul id="menu">
    <li>
    <a href="#">Dropdown 1</a>
    <ul>
    <li><a href="http://www.pivotx.net/">PivotX</a></li>
    <li><a href="http://www.wordpress.org/">WordPress</a></li>
    <li><a href="http://www.textpattern.com/">Textpattern</a></li>
    <li><a href="http://typosphere.org/">Typo</a></li>
    </ul>
    </li>
    <li>
    <a href="#">Dropdown 2</a>
    <ul>
    <li><a href="http://www.pivotx.net/">Patrick</a></li>
    <li><a href="http://www.wordpress.org/">Is Really</a></li>
    <li><a href="http://www.textpattern.com/">Awesome</a></li>
    <li><a href="http://typosphere.org/">Isn't He?</a></li>
    </ul>
    </li>
    <!--nav--><!--nav2-->

    </ul>
    <!--sidebar-->