title: jQuery how to "chain" a conditional/function
body: <p>I have the following block of code:</p>
  
  <pre><code>if (current &lt;= total) {
  
              $next.css({opacity: 0.0})
              .addClass("active")
              .animate({opacity: 1.0}, 1000, function() {
                  current -= 1;
                  if (current == 1)
                      {
                          jQuery("#next").animate({opacity: 0}, 500); 
                          next_isShowing = false;
                      }
                  if (!prev_isShowing) 
                      {
                          jQuery("#prev").animate({opacity: 1.0}, 500); 
                      }
  
  
              });
  </code></pre>
  
  <p>The only thing is, I actually want to move this block of code before the ".animate":</p>
  
  <pre><code>    current -= 1;
  if (current == 1)
              {
                  jQuery("#next").animate({opacity: 0}, 500); 
                  next_isShowing = false;
              }
  </code></pre>
  
  <p>Is there a way to take this block of text and "chain" it into my current chain?</p>