To scroll smoothly to an anchor on your webpage with jQuery, you can use following snippet:
$(".anchor").click(function(e) {
e.preventDefault();
anchor = $(this).attr('href');
$("html, body").animate({
'scrollTop': $(anchor).offset().top
}, 1000);
});
Continue reading