Smooth Scroll Between pages JS

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

<script>

//when you click on a link in one page, if the link leads to an anchor in another page, this will will load the new page on the top and smooth scroll down to the anchor

$(document).ready(function () {

var urlHash = window.location.href.split("#")[1];

if (urlHash.length > 0)

$('html,body').animate({

scrollTop: $('#' + urlHash).offset().top

}, 875);

});

</script>

 

See also: Effects