title: Wordpress drop-down-menu open on click
body: <p>I'm trying to make a wordpress drop-down menu that opens on click. Thing is it should stay open when you select a post and the page loads that post. Problem is I'm using custom menu item link which anchor links to nothing ("#") just to make them clickable. The menu opens when I click the "Clickable 2nd level title item", but links on the "3rd level posts" don't work but instead the menu closes when I click them.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;li id="menu-item-272" class="main menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-272"&gt;&lt;a href="#"&gt;Main menu title item&lt;/a&gt;
  &lt;ul class="sub-menu" style="display: block;"&gt;
      &lt;li id="menu-item-740" class="third menu-item menu-item-type-post_type menu-item-object-post menu-item-740"&gt;&lt;a href="http://xyz.com"&gt;Post 1st lvl&lt;/a&gt;&lt;/li&gt;
      &lt;li id="menu-item-741" class="third menu-item menu-item-type-post_type menu-item-object-post menu-item-741"&gt;&lt;a href="http://xyz.com"&gt;Post 1st lvl&lt;/a&gt;&lt;/li&gt;
      &lt;li id="menu-item-742" class="third menu-item menu-item-type-post_type menu-item-object-post menu-item-742"&gt;&lt;a href="http://xyz.com"&gt;Post 1st lvl&lt;/a&gt;&lt;/li&gt;
      &lt;li id="menu-item-743" class="third menu-item menu-item-type-post_type menu-item-object-post menu-item-743"&gt;&lt;a href="http://xyz.com"&gt;Post 1st lvl&lt;/a&gt;&lt;/li&gt;
      &lt;li id="menu-item-744" class="second bez menu-item menu-item-type-custom menu-item-object-custom menu-item-744"&gt;&lt;a href="#"&gt;Clickable 2nd level title item&lt;/a&gt;
      &lt;ul class="sub-menu" style="display: none;"&gt;
          &lt;li id="menu-item-288" class="third menu-item menu-item-type-taxonomy menu-item-object-category menu-item-type-post_type menu-item-object-post menu-item-288"&gt;&lt;a href="http://xyz.com"&gt;Post 3rd lvl&lt;/a&gt;&lt;/li&gt;
          &lt;li id="menu-item-290" class="third menu-item menu-item-type-taxonomy menu-item-object-category menu-item-type-post_type menu-item-object-post menu-item-290"&gt;&lt;a href="http://xyz.com"&gt;Post 3rd lvl&lt;/a&gt;&lt;/li&gt;
          &lt;li id="menu-item-292" class="third menu-item menu-item-type-taxonomy menu-item-object-category menu-item-type-post_type menu-item-object-post menu-item-292"&gt;&lt;a href="http://xyz.com"&gt;Post 3rd lvl&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>$('#menu-header ul.sub-menu li.second:not(".third")').toggle(function() {
          $(this).find('ul.sub-menu:first-of-type')
              .stop(true, true).delay(50).show("slow");
      }, function(){
          $(this).find('ul.sub-menu:first-of-type')
              .stop(true, true).delay(150).animate({ "height": "hide", "opacity": "hide" }, 400 );
      });
  </code></pre>