title: Keep parent menu item highlighted after hovering over submenu (HTML/CSS/Jquery)
body: <p>I have a menu with the possibility that some menu items will have subitems. Pretty simple, actually. I would like to achieve that once the submenu is moused over, the corresponding (parent) menu item is highlighted as well. This never happens because seems like as soon as the mouse leaves the menu item and gets over the submenu, the browser styles it to its default style. Any help appreciated! Thanks a lot!</p>
  
  <p>Menu html: </p>
  
  <pre><code>&lt;div id="top_navigation"&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="#"&gt;item1&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;item2&lt;/a&gt;
                  &lt;ul class="submenu"&gt;
                      &lt;li&gt;&lt;a href="#"&gt;sub1&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#"&gt;sub2&lt;/a&gt;&lt;/li&gt;
                      &lt;li class="selected_menu_item"&gt;&lt;a href="#"&gt;sub3&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;item3&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;item4&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>#top_navigation {
      width: 1248px;
      margin: 0 auto;
      position: relative;
      text-transform: uppercase;
      font-family: "Rounded Font", sans-serif;
      font-size: 23px;
  }
  #top_navigation ul ul {
      display: none;
  }
  #top_navigation ul {
      padding-left: 0;
  }
  #top_navigation ul li {
      margin: 0;
      padding: 0;
      float: left;
      width: 312px;
      height: 64px;
      line-height: 64px;
      font-size: 20px;
      list-style: none;
  }
  #top_navigation ul li a {
      display: block;
      text-align: center;
      text-decoration: none;
      color: #eb1f10;
      background-color: #FFF;
  }
  #top_navigation ul li.selected_menu_item a {
      background-color: #eb1f10;
      color: #FFF;
  }
  #top_navigation ul li a:hover {
      background-color: #eb1f10;
      color: #FFF;
  }
  #top_navigation li li {
      height: 42px;
      line-height: 42px;
      border-top: #eb1f10 1px solid;
  }
  </code></pre>
  
  <p>JS/Jquery:</p>
  
  <pre><code>$(document).ready(function () {
      var $nav = $('#top_navigation &gt; ul &gt; li');
      $nav.hover(
          function() {
              $('ul', this).stop(true, true).slideDown('fast');
          },
          function() {
              $('ul', this).slideUp('fast');
          }
      );
  });
  </code></pre>
  
  <p>Example can be found here: <a href="http://jsfiddle.net/qguTz/">http://jsfiddle.net/qguTz/</a></p>