1
Fork 0

Clear hash when scrolling to top

This commit is contained in:
Jake Howard 2021-12-30 20:20:19 +00:00
parent 8915b12414
commit 6ac31eb8e0
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -55,9 +55,9 @@ function scrollTo(offset) {
);
}
$('#scroll-top').on('click', function(event) {
event.preventDefault();
$('#scroll-top').on('click', function() {
scrollTo(0);
window.history.pushState('', document.title, window.location.pathname); // Reset hash in URL
});
$('a[href^="#"] ').on('click', function(event) {