(Squarespace) When users access page, scroll to top

If you have problems with your browser automatically scrolling to the bottom or a specific position when you first visit the page. You can follow these steps to fix problem.

#1. First, hover on Page Name (Main Navigation or Not Linked) > click Gear icon

#2. Click Advanced > Paste this code to Page Header Code Injection.

<script>
document.addEventListener('DOMContentLoaded', function() {
  window.scrollTo({
    top: 0,
    left: 0,
    behavior: 'smooth'
  });
});
</script>

1 Like