

Thaddeus
Member
-
Thaddeus posted an update 2 months ago
I’ve created a single-page website with anchor links. When I click on the ‘Contact’ menu item, it smoothly scrolls down to the ‘Contact’ section. I want to disable the smooth scrolling effect and have the page directly jump to the ‘Contact’ section without any scrolling animation. How can I achieve this?
Sterling-
You can disable the smooth scrolling behavior using the following JavaScript code:
window.addEventListener(‘load’, () => {
// Disable smooth scrolling once the page has fully loaded
document.documentElement.style.scrollBehavior = ‘auto’;
});
-