title: Chaining and Callback Syntax
body: <p>I am trying to understand the chaining and callback functions, but it seems I am missing something, since the code below does not work and stops before <em>slideDown</em>.</p>
  
  <p>I would like to change the color of a paragraph to red when clicking on a button and then change the color to blue before initiating the <em>fadeOut</em>. Here is my code, based on a <a href="https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_chaining2" rel="nofollow noreferrer">W3Schools Tryit Example</a>;</p>
  
  <pre><code>  $("button").click(function(){
      $("#p1").css("color", "red")
        .slideUp(2000)
        .slideDown(2000,css("color", "blue"))
        .fadeOut(2000);
    });
  </code></pre>
  
  <p>What is the proper way of doing the above?</p>