title: jQuery box height problem - using slideUp/Down
body: <p>I have a box on my site that when a button is clicked, the box slides up, some new text is loaded into it, and then it slides down revealing the new text. Here is the code I have written for it in jQuery:</p>
  
  <pre><code>$("#generate").click(function(){
      var $target = $("#lyric");
      $target.slideUp();
      $target.queue(function(){
          $("#generate").text('Loading...');
          $target.load('lyrics.php', function(){
              $("#generate").text('Get another lyric');
              $target.dequeue();
          });
      });
      $target.slideDown();
  });
  </code></pre>
  
  <p>The problem is that the box changes height once it has slid up, because the new text may be shorter or longer. This means that when the box slides down it jerks once it gets to the 'old' height of the box to the new height of the box.</p>
  
  <p>Here is an example of the html, everything inside 'lyric' is spat out by the 'lyric.php' file:</p>
  
  <pre><code>&lt;div id="lyric"&gt;
  &lt;div&gt;
  &lt;p class="quote"&gt;Come ride with me, through the veins of history, I'll show you how god, falls asleep on the job&lt;/p&gt;
  &lt;p&gt;&lt;span class="artist"&gt; - Muse, &lt;/span&gt;&lt;span class="song"&gt;Knights Of Cydonia&lt;/span&gt;&lt;/p&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And the CSS:</p>
  
  <pre><code>#lyric div {
      padding: 18px 0;
  }
  p.quote {
      border-left: 2px solid rgb(100, 130, 130);
      font-style: italic;
      padding-left: 16px;
      padding-top: 0;
  }
  .artist {
      color: #E8E8E8;
      font-weight: bold;
  }
  </code></pre>
  
  <p>I tried mucking around with a custom animation, but I haven't been able to mimic slideUp/Down and sort the box height issue out. Any help is greatly appreciated.</p>