title: JQuery 1 Click fires 2 conditions (if)
body: <pre><code>$('.anfahrt').click(function() {
      $button = $(this);
      if ( clickedc == 0){
          if( !$button.hasClass( 'disabled' ) ) {
              $button.addClass( 'disabled' );
              clickedc = 1
              $('.lupe').animate({opacity: '0'},750)
              $('.card &gt; img').animate({height: 150, width: 193, opacity: '1', left: 0, top: 9},500)
              $('.contact-content2').animate({opacity:'1'},500).animate({opacity: '0'},500)
              $('.cardgreen &gt; img').animate({height:150, width: 193, opacity: '0'},500).animate({opacity: '1', top: 9},500,
              function() { $button.removeClass('disabled') }
              );
          } 
      }
  });
  
  $(document).(click(function() {
      $button = $(this);
      if ( clickedc == 1){
          if( !$button.hasClass( 'disabled' ) ) {
              $button.addClass( 'disabled' );
              clickedc = 0
              $('.cardgreen &gt; img').animate({opacity: '0'},300).animate({height:0,width:0});
              $('.contact-content2').show(0).animate({opacity: '1'},300)
              $('.clickding').animate({width: '0', height: '0'},0)
              $('.card &gt; img').animate({opacity: '1'},300)
                  .animate({opacity: '0', width: 0, height: 0, left:194, top:75},270,
              function() { $button.removeClass('disabled') }
              );
          } 
      }
  }));
  </code></pre>
  
  <p>So I click on the div.. and the animation start (fadein). Then it should stop... Then user clicks everywhere on the document and the 2nd animation (fadeout) should start. - But that does not work .. cause when I click the Div the fadein animation starts after that the 2nd animation starts right away. Theres no stop.. pls help me how to fix this.</p>