Jump to content

JQuery Drop Down menu system


melting_dog

Recommended Posts

Hi all,

Im constructing a JQuery drop down menu system and have come accross two problems. The first is that when the page first loads the submenu is visable (but works properly when i roll over it) and the 2nd is that I cannot seem to repeat the process for the the other items in the navigation menu - it only works for the first one.

 

Here is my code:

<script src="jquery-1.4.2.min.js" type="text/javascript"></script>

 

<script type="text/javascript">

$(document).ready(function(){

 

$(function() {

    $('#nav li').hover(function() {

          $('div.subMenu', this).show(400);

      }, function() {

          $('div.subMenu', this).hide(400);

      });

});  

 

$(function() {

    $('#nav li').hover(function() {

          $('div.subMenu2', this).show(400);

      }, function() {

          $('div.subMenu2', this).hide(400);

      });

});

 

});

</script> 

 

 

 

<div id="nav">

<ul>

    <li><a href="index.php"><img src="images/homeBtn.gif" alt="Home"/></a>

        <div class="subMenu">Return to the home page.</div></li>

      <li><a href="about.php"><img src="images/aboutBtn.gif" alt="About"/></a></li>

        <div class="subMenu2">Learn more about the SDM&A.</div></li>

</div>

 

Any help would be greatly appreciated!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.