Scroll To Element With JQuery

Posted By Weston Ganger

If you want to smoothly scroll to an element using jQuery its pretty easy. Heres how:

$("#button").click(function() {
  $('html, body').animate({
    scrollTop: $("#elementtoScrollToID").offset().top-50px
  }, 2000);
});

Related External Links:

Article Topic:Software Development - Javascript

Date:May 11, 2015