title: Maintaining a css :hover effect for all items up a nested list chain
body: <p>So, I have DOM that looks like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul id="nav"&gt;
    &lt;li&gt;&lt;a&gt;Hello&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;
      &lt;a&gt;OuterMenu&lt;/a&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a&gt;InnerMenu1&lt;/a&gt;
          &lt;ul&gt;&lt;li&gt;&lt;a&gt;InnerMenu2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a&gt;Item 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a&gt;Item 2&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>which looks like this:</p>
  
  <pre><code>+Hello              +OuterMenu
                      ----InnerMenu1--------------InnerMenu2
                      ----Other list item         Item 1
                                                  Item 2
  </code></pre>
  
  <p>That is, the first menu is horizontal, the next menu is directly below the first menu, and all subsequent inner menus appear directly to the right [<a href="http://www.kriesi.at/archives/create-a-multilevel-dropdown-menu-with-css-and-improve-it-via-jquery" rel="nofollow">see example here</a>]. </p>
  
  <p>This works fine, but I need the hover styles for each outer menu to persist as each inner menu is selected. When the user is hovering over <code>Item 1</code>, <code>Item 1</code>, <code>InnerMenu</code>, and <code>OuterMenu</code> should be highlighted, and when the user moves off of the whole menu tree, then and only then should <code>OuterMenu</code> no longer be highlighted. Is there a better way to do this than trying to manage a <code>hover</code> and <code>mouseout</code> event on every single list item?</p>
  
  <p>I'm looking for a clean implementation here.</p>