title: Force window closed at correct hyperlink
body: <p>Following on from <a href="https://stackoverflow.com/questions/27254002/jquery-align-div-to-link">jQuery Align DIV to Link</a>.</p>
  
  <p>I've now got a working script that opens a window next to the link I click.</p>
  
  <p>The issue I have is what happens when another link is clicked when the window is open.  If I click on Link D the window opens.  If I then click on Link A whilst the window is open at 'D' the window closes at Link A.</p>
  
  <p>This <strong><a href="http://jsfiddle.net/bm0sascz/6/" rel="nofollow noreferrer">FIDDLE</a></strong> shows what I mean.</p>
  
  <p>What I'd like to do is either. Close the open window and reopen at the new link, or only allow closing via the close link only.</p>
  
  <p>This is the code I'm using:</p>
  
  <pre><code>function deselect(e) {
    $('.pop').slideFadeToggle(function() {
      e.removeClass('selected');
    });    
  }
  
  $(function() {
          $("[id$='contact']").click(function(){
  
      if($(this).hasClass('selected')) {
        deselect($(this));               
      } else {
        $(this).addClass('selected');
        $(".messagepop").css( {position:"absolute",
                               top:$(this).offset().top,
                               left: $(this).offset().left});
        $('.pop').slideFadeToggle();
      }
      return false;
    });
  
    $('.close').on('click', function() {
      deselect($('#contact'));
      return false;
    });
  });
  
  $.fn.slideFadeToggle = function(easing, callback) {
    return this.animate({ opacity: 'toggle', height: 'toggle' }, 'fast', easing, callback);
  };
  </code></pre>
  
  <p>Any idea who I can do this ?</p>