title: auto animated scroll down using jQuery
body: <p>I am trying to make an animated scroll to a bottom button using jQuery that fades out when the page is located at the bottom. I have found this code on the internet and modified it, but I could not get it work.</p>
  
  <pre><code> &lt;script&gt;
      //to bottom
      $(document).ready(function(){
  
          // hide #back-top first
  
          $("#back-bottom").show();
  
          // fade in #back-top
          $(function () {
              $(window).scroll(function () {
                  if ($(this).scrollTop()  1) {
                      $('#back-bottom').hide();
                  } else {
                      $('#back-bottom').show();
                  }
              });
  
              // scroll body to 0px on click
              $('#back-bottom a').click(function () {
                  $('body,html').animate({ scrollTop: 0 }, 800);
                  return false;
              });
          });
  
      });
      &lt;/script&gt;
  </code></pre>