scroll to element jquery
snippet in javascript

scroll to element jquery

user8540

$('html, body').animate({
  scrollTop: $("#grepperRocks").offset().top
});

jquery scroll to element

user9416

$("#button").click(function() {
    $([document.documentElement, document.body]).animate({
        scrollTop: $("#elementtoScrollToID").offset().top
    }, 2000);
});