How to disable smooth scrolling during page navigation?

Either CSS-only or using JS is fine.
1 Reply
jcayzac
jcayzacOP4mo ago
Hmm maybe I can just use the DOM ready event as a boundary… Yes, this works fine:
html:not(.noscroll) {
scroll-behavior: smooth;
}
html:not(.noscroll) {
scroll-behavior: smooth;
}
<html class="noscroll">
<html class="noscroll">
addEventListener('DOMContentLoaded', () => {
document.documentElement.classList.remove('noscroll')
})
addEventListener('DOMContentLoaded', () => {
document.documentElement.classList.remove('noscroll')
})
Want results from more Discord servers?
Add your server