s
4 years ago in Plain Text
$("#main-nav a").on('click', function (event) {
if (this.hash !== "") {
event.preventDefault();
const hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function () {
window.location.hash = hash;
});
}
});