jQuery scroll to for anchor tags and "to top" buttons with push state of hash.
$(function () {
$('a[href^="#"]').on('click', function (e) {
e.preventDefault();
var anchorID = $(this).attr('href');
var anchorPos = $(anchorID).offset();
$('html, body').animate({scrollTop: anchorPos.top}, 400, function () {
location.hash = anchorID;
});
});
});