JQuery drop down menu help1

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

JQuery drop down menu help1

MeltingDog
Hi all.
Im trying to make a drop down menu system using jquery, but i cannot seem to make more then the first item work. Its driving me nuts. Can anyone help?

Here the code:

<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript"> $(document).ready(function(){ $(function() { $('div.subMenu').hide(); $('#nav li').hover(function() { $('div.subMenu', this).show(400); }, function() { $('div.subMenu', this).hide(400); }); }); $(function() { $('div.subMenu2').hide(); $('#item2 li').hover(function() { // Apply hover to the li, not the anchor $('div.subMenu2', this).show(400); // Find the subMenu within this li }, function() { $('div.subMenu2', this).hide(400); }); }); }); </script> 

And the HTML:

<div id="nav">
        <ul>
    <li>Home
        <div class="subMenu">Return to the home page.</div></li>
        <li>About</li>
        <li><div class="subMenu2">Learn more about the SDM&A.</div></li>
</ul>
</div>

Any help would be greatly appreciated!