title: jQuery. How is queue() different from using callback function for something is done?
body: <p>html:</p>
  
  <pre><code>&lt;span&gt;hello world!&lt;/span&gt;
  </code></pre>
  
  <p>js: (using callback)</p>
  
  <pre><code>$('span').click(function() {
    $(this).animate({
      fontSize: '+=10px'
    }, 'slow', function() {
      // callback after fontsize increased
      $(this).text(  $(this).text() + ' rolled! ' );
    });
  });
  </code></pre>
  
  <p>So that every time <code>SPAN</code> is click, text 'rolled' appended after font size increased, instead of happening together.</p>
  
  <p>And it can be done by using queue() as well like this:</p>
  
  <p>js: (using queue())</p>
  
  <pre><code>$('span').click(function() {
    $(this).animate({
      fontSize: '+=10px'
    }, 'slow'})
    .queue(function() {
      $(this).text(  $(this).text() + ' rolled! ' );
    });
  });
  </code></pre>
  
  <p>I am not sure what is the difference between them. both do the same thing. </p>
  
  <p><strong>Why is queue() better/prefer than using callback, (or why is not ) ? What is special about queue()?</strong></p>
  
  <p>Thanks. </p>