Thanks for this article. For the version without any library it would be nice to use the intersection observer rather that the onScroll event. That would be much more efficient
here is an article in Vanilla JS about implementing a back to top button with Observers
it is pretty similar to fetching new scrollable items m.signalvnoise.com/how-to-back-to-...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for this article. For the version without any library it would be nice to use the intersection observer rather that the onScroll event. That would be much more efficient
Thanks for the suggestion. Do you have any reference for that?
developer.mozilla.org/en-US/docs/W...
Not supported in IE11 though, if that is of any concern
you can find a polyfill
Yeah, or write a tiny abstraction on top of the code that is already there, that is "probably" better.
here is an article in Vanilla JS about implementing a back to top button with Observers
it is pretty similar to fetching new scrollable items
m.signalvnoise.com/how-to-back-to-...