title: WordPress Sub Menu - Show On Hover
body: <p>I have a WordPress site set up with some navigation.  Each of the parent nav links contains sub menus.</p>
  
  <p>What I want to do in psuedoish code is as follows:</p>
  
  <ul>
  <li>If current page, then show current page sub menu;</li>
  </ul>
  
  <p>BUT</p>
  
  <ul>
  <li>Even if current page, if another parent link is hovered on then show that sub menu instead.  Once hover state no longer exists, revert to current page sub menu.</li>
  </ul>
  
  <p>At the moment I have this:</p>
  
  <p>JQUERY</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
      jQuery(document).ready(function($){
      $(".sub-menu").hide();
      $(".current_page_item .sub-menu").show();
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>This successfully shows the current pages sub menu for all pages but I can't work out how to show another sub menu if it's parent link is hovered upon.</p>
  
  <p>The sub menu occupies exactly the same space so upon a hover it should hide the current pages sub menu links.</p>
  
  <p>Can someone please help.</p>
  
  <p>Thanks in advance.</p>
  
  <p>HTML</p>
  
  <pre><code>    &lt;li id="menu-item-30" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-30"&gt;&lt;a href="http://localhost:81/pps/"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li id="menu-item-34" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-16 current_page_item menu-item-34"&gt;&lt;a href="http://localhost:81/pps/?page_id=16"&gt;Our Services&lt;/a&gt;
      &lt;ul class="sub-menu" style="display: block;"&gt;
          &lt;li id="menu-item-36" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-36"&gt;&lt;a href="http://localhost:81/pps/?page_id=18"&gt;Services Sub Page One&lt;/a&gt;&lt;/li&gt;
          &lt;li id="menu-item-37" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-37"&gt;&lt;a href="http://localhost:81/pps/?page_id=20"&gt;Services Sub Page Two&lt;/a&gt;&lt;/li&gt;
          &lt;li id="menu-item-35" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-35 no-cross"&gt;&lt;a href="http://localhost:81/pps/?page_id=22"&gt;Services Sub Page Three&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li id="menu-item-38" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-38"&gt;&lt;a href="http://localhost:81/pps/?page_id=24"&gt;Why Us?&lt;/a&gt;
      &lt;ul class="sub-menu" style="display: block;"&gt;
          &lt;li id="menu-item-46" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-46"&gt;&lt;a href="http://localhost:81/pps/?page_id=44"&gt;Subpage of Why Us?&lt;/a&gt;&lt;/li&gt;
          &lt;li id="menu-item-50" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-50 no-cross"&gt;&lt;a href="http://localhost:81/pps/?page_id=48"&gt;Another Subpage Of Why Us?&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  </code></pre>