title: Clicking on multilevel dropdown not displaying the menu
body: <p>I am multi level dropdown menu in my website.When i am clicking on main menu it is displaying the sub menu but when i am clicking on that submenu it is sliding up the menu not displaying the menu.Here is the code for that</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.main-menu ul li a').click(function(e) {
    if ($(this).next().hasClass('sub-menu')) {
      e.preventDefault();
      $('.sub-menu').slideUp();
      $('.main-menu ul li a').removeClass('active');
      if ($(this).next('.sub-menu').is(':visible')) {
        $(this).removeClass('active');
        $(this).next('.sub-menu').slideUp();
      } else {
        $(this).addClass('active');
        $(this).next('.sub-menu').slideToggle();
      }
    }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="main-menu"&gt;
    &lt;ul id="menu-main-menu" class="menu"&gt;
      &lt;li class="menu-item"&gt;
        &lt;a href="http://localhost/barcoun/"&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;
      &lt;/li&gt;
      &lt;li class="menu-item"&gt;
        &lt;a href="http://localhost/barcoun/about-us/"&gt;&lt;span&gt;About Us&lt;/span&gt;&lt;/a&gt;
      &lt;/li&gt;
      &lt;li class="menu-item"&gt;
        &lt;a href="http://localhost/barcoun/contact-us/"&gt;&lt;span&gt;Contact Us&lt;/span&gt;&lt;/a&gt;
      &lt;/li&gt;
      &lt;li class="menu-item"&gt;
        &lt;a href="#" class="menu-image-title-after"&gt;&lt;span&gt;Enrolments&lt;/span&gt;&lt;/a&gt;
        &lt;ul class="sub-menu" style="display: none"&gt;
          &lt;li class="menu-item"&gt;
            &lt;a href="#"&gt;&lt;span&gt;Enrolment&lt;/span&gt;&lt;/a&gt;
            &lt;ul class="sub-menu" style="display: none"&gt;
              &lt;li class="menu-item"&gt;
                &lt;a href="http://localhost/barcoun/enrollment-details-by-bar-association/"&gt;&lt;span&gt;Enrolment Details&lt;/span&gt;&lt;/a&gt;
              &lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>