0

how do I change my function, to go to the bottom of the page instead to top ?

    $(window).scroll(function() {
   if ($(this).scrollTop() > 100) {
     $('.back-to-top').fadeIn('slow');
   } else {
     $('.back-to-top').fadeOut('slow');
   }
 });

 $('.back-to-top').click(function() {
   $('html, body').animate({
    scrollTop: 0
  }, 1500, 'easeInOutExpo');
  return false;
 })

thats the a tag

    <a href="#about" class="btn-get-started scrollto">Contact</a>
daniel ragimov
  • 175
  • 1
  • 1
  • 10

1 Answers1

1
$(window).scroll(function() {
  if ($(this).scrollTop() > 100) {
    $('.back-to-top').fadeIn('slow');
  } else {
    $('.back-to-top').fadeOut('slow');
  }
});

$('.back-to-top').click(function() {
  $('html, body').animate({
    scrollTop: $(document).height()
  }, 1500, 'easeInOutExpo');
  return false;
})
Paulo Mendonça
  • 635
  • 12
  • 28