MoveTo – A lightweight scroll animation JS library without any dependency
github.com
github.com
Smooth scrolling is enabled by default in browsers and as a user I've therefor actively opted out of that behaviour because I genuinely dislike it and feel that it destroys my user experience. By forcing that experience on me I will have the same feelings towards your website.
mousewheel.min_line_scroll_amount set to 30 (you might need to play with it)
generally works much better.To even get to chrome://flags I have to (on first run) do google-chrome --disable-gpu then change the flag then restart.
After that everything works flawlessly, it took me a while to track that one down!.
[1] https://developer.mozilla.org/en/docs/Web/CSS/scroll-behavio... [2] https://developer.mozilla.org/en-US/docs/Web/API/Element/scr...
Sigh.
The reason I'm asking is that I've often ran into problems with similar no-dependency libraries in highly dynamic environment, that they often leave dangling event handlers on elements, that have been since removed from the page. That leads to various memory leaks and weird bugs.
This is basically a wrapper for the `move` function that is defined in 50 lines of code.
As a developer, I gain more by understanding those 50 lines of code than understanding how to import and call this.
Support[1] is still limited, but you can (and should) polyfill[2] it.
[0]: https://drafts.csswg.org/cssom-view/
Seriously though, the fact that this breaks the standard behavior of the anchor point becoming part of the URL bothers me more than the animation. When I hover over a link and see a URL, I'd really like clicking it to take me to that URL.
Most of the comments are -ve because they think it's about scroll jacking.
"A lightweight smooth scrolling javascript library ..."
to
"A lightweight scroll animation JS library ..."
EDIT: I'm stupid this is isn't related to user input scroll, but anchor like scroll just smooth
edit: link to demo https://hsnaydd.github.io/moveTo/demo/ solid work imho
Perhaps the library would benefit from not describing itself as 'smooth scrolling', which many of us might associate with 'hijacking the scroll wheel/trackpad'.
1) It's intrusive and destroys the user experience which ironically is what it pretends to enhance.
2) Even if it feels right on the designer's machine, we never know what scrolling implementations there may be in the future that will certainly break such gimmicks.