title: JQuery - "Read More" slide animation
body: <p>I created a blog and added a plugin to truncate the text by height with a "Read More" button.</p>
  
  <p>This is the javascript function:</p>
  
  <pre><code>(function ( $ ) {
  $.fn.readMoreFade = function(options) {
      var settings = $.extend({
          backgroundColor: "white",
          buttonClass: "button"
      }, options );
  
      this.css( "height", 325 );
      this.css( "overflow", "hidden" );
      this.css( "position", "relative" );
      this.append('&lt;p class="readMoreFade"&gt;&lt;a href="#" class="btn btn-red"&gt;Ler Mais&lt;/a&gt;&lt;/p&gt;')
  
      var readMoreButton = this.find('.readMoreFade');
      var backgroundString = settings.backgroundColor ? settings.backgroundColor : this.css('background-color');
  
      readMoreButton.css('background-image', '-webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(0,255,255,0)),color-stop(1, '+backgroundString+'))');
      readMoreButton.css('text-align', 'center');
      readMoreButton.click(function(){
              totalHeight = 0
  
              $el = $(this);
              $p  = $el;
              $up = $p.parent();
              $ps = $up.find("p:not('.readMoreFade'), ul:not('.readMoreFade'), ol:not('.readMoreFade'), img:not('.readMoreFade'), h2:not('.readMoreFade'), h3:not('.readMoreFade'), h4:not('.readMoreFade'), h5:not('.readMoreFade')");
  
              $ps.each(function() {
                  totalHeight += $(this).outerHeight();
              });
  
              $up
                  .animate({
                      "height": totalHeight
                  });
  
              // fade out read-more
              $p.fadeOut();
  
              // prevent jump-down
              return false;
      })
  
      return this;
  };
  </code></pre>
  
  <p>}( jQuery ));</p>
  
  <p>But, the thing is: it is giving a lot of space after the text is finished.
  I would like to know if there is a way to "delete" this blank space (yellow space in the image below)</p>
  
  <p><a href="https://i.stack.imgur.com/AzOWL.png" rel="nofollow noreferrer">Image</a></p>