title: jquery: hide a popup on mouseleave event of trigger or popup
body: <p>I have a popup menu appearing onclick event of an element on my page like this...</p>
  
  <pre><code>$('.triggerDiv').click(function() {
      var pos = $(this).offset();
      $('#popupDiv').css({
              "left": (pos.left + this.width()) + "px",
              "top": pos.top + "px"
          }).slideDown();
  });
  </code></pre>
  
  <p>I also have a mouseleave event attached to the popup to hide it on mouseleave.</p>
  
  <pre><code>$('#popupDiv').mouseleave(function() {
      $('#popupDiv').slideUp();
  });
  </code></pre>
  
  <p>What I want to do is hide the popup if the mouse leaves the trigger as well. Simple solution would be - </p>
  
  <pre><code>$('.triggerDiv').mouseleave(function() {
      $('#popupDiv').slideUp();
  });
  </code></pre>
  
  <p>But the problem is that I have multiple trigger elements on the page that all display the same popup onclick. In this case how can I correctly handle the mouseleave event to hide/show the popup?</p>