So earlier I wrote a small snippet of code to implement a smooth scroll on my webpage. Initially it was working fine, but as developing progressed it randomly stopped working and has not started working since. Now when it scrolls there is a delay from when you press the button and then eventually it snaps to the part of the page its targeting.
Here is the script tag for the library:
<script src="https://cdn.jsdelivr.net/gh/cferdinandi/smooth-scroll@15.0.0/dist/smooth-scroll.polyfills.min.js"></script>
And here is the javascript:
const scroll = new SmoothScroll('nav a[href*="#"]',{
speed: 800
});
I do not want to use the CSS scroll-behavior: smooth because most of my sites traffic will be on Safari which doesn't support that.