title: How do I add a pause in JavaScript?
body: <p>I have a div like this:</p>
  
  <pre><code>&lt;div style="width: 0%;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>How can I change the css of <code>width</code> to <code>100%</code> (and wait until it reaches 100%) before changing more elements?</p>
  
  <p>For example:</p>
  
  <pre><code>$('div').css('width', '100%', function() {
      $('div').css('color', 'red');
  });
  </code></pre>
  
  <p>Obviously this doesn't work, but how can I make it work?</p>