Q:

Dropdown menu not closing jQuery

Can someone explain me what I'm doing wrong, if you click on the first link(link 1) it opens a menu, if you click on one of the 'li' inside the menu it closes the menu. 
If I click on the second link(link 2) it opens a different menu but when I click on one of the 'li' inside the menu nothing happens, and what I am trying to do is to close the menu. 
jsfiddle (http://jsfiddle.net/BdhxL/)
The HTML code:
<a href="#">Link 1</a> 
        <div id="dropMenu">
          <ul>
            <li><a href="#index">Portfolio</a></li> 
          </ul> 
        </div>
 <br><br>   
    <a href="#">Link 2</a> 
        <div id="dropMenu">
          <ul>
            <li><a href="#index">Contact us </a></li> 
          </ul> 
        </div>

The JS code:
$(document).ready(function() {
  $("li").click(function()
  {
    $("#dropMenu").hide("slow");
  });

  $("a").click(function()
  {
    $(this).toggleClass("active");
    $(this).next("div").stop('true','true').slideToggle("slow");
  });
});

 #dropMenu {
    display: none; 
    position: relative; 
    right: 5px; 
    background: #000; 
    color: black; 
    margin:50px -5% 0% -142%;
    padding: 0px 0px 0px 10px; 
}

#dropMenu a { 
    display: block; 
    color: #fff; 
    text-decoration: none; 
    padding:10px 6px;
    font-weight:400;
    border-bottom: solid 1px #fff;

}

The CSS code:
#dropMenu ul {
    margin:0;
}

#dropMenu a:hover { 
    background: #57585A; 
}

#dropMenu ul {
    list-style:none;
    padding:0;
}

A:

You have duplicate ids.$("#dropMenu").hide("slow"); is always targetting first dropMenu.  Use $(this) to target current and hide the closest div. Try this:
$(document).ready(function() {
 $("li").click(function()
 {
  $(this).closest("div").hide("slow");
});

 $("a").click(function()
 {
  $(this).toggleClass("active");
  $(this).next("div").stop('true','true').slideToggle("slow");
});});

Working Demo

