title: Dropdown menu - slideToggle challenge
body: <p>Following is my code</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>$(document).ready(function(){
    $('.submenu').hide();
    $('.menu').click(function(event){
      event.preventDefault();
      $(this).children('.submenu').slideToggle(1000);
      event.stopPropagation();
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>li, body, a{
    list-style:none;
    padding:0;
    margin:0;
    color:white;
    text-decoration:none;
  }
  
  ul{
    display:flex;
    margin:0;
    margin:0;
    background:red;
  }
  
  .menu{
    background:black;
    color:white;
    border-right:2px solid white;
    height:5rem;
    width:5rem;
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
  }
  
  .submenu{
    height:300px;
    width:300px;
    background:purple;
    position:absolute;
    top:5rem;
    left:0;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;ul&gt;
    &lt;li class='menu'&gt;
      &lt;a href=''&gt;Page 1&lt;/a&gt;
      &lt;div class='submenu'&gt;
        &lt;div class='page_title'&gt;&lt;/div&gt;
        &lt;div class='page_description'&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/li&gt;
    
    &lt;li class='menu'&gt;
      &lt;a href=''&gt;Page 2&lt;/a&gt;
      &lt;div class='submenu'&gt;
        &lt;div class='page_title'&gt;&lt;/div&gt;
        &lt;div class='page_description'&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/li&gt;
      
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am trying to achieve two things in this.</p>
  
  <ol>
  <li><p>When I click on the second link, the first submenu should slide Up and second open should slide down.</p></li>
  <li><p>Here, when I click inside the first submenu after the slide down, it closes up. I want do not want it to close down, but only closes when I click on the same link tag or the next link</p></li>
  <li><p>Alternatively, it will be great, if it can slide up when I click outside of the submenu on the body.</p></li>
  </ol>
  
  <p>Any assistance is highly appreciated</p>
  
  <p>Thanks</p>