Minimal Smooth and Drag Scroll āŸ‹ lib

site profile thumbnail

Description

Revising my boilerplate, needed a scroll so made one. Smooth Scroll + Mouse Drag Scroll (optional), in less than 200 lines of vanilla JS. Completely configured by data-attributes for wf. You can control the scrolling element (data-scroll), a factor for scroll speed (data-factor="{number}" and if mouse dragging is supported (data-mouse="true/false"). It's also webGl ready and supports speed, but for that you'll want to fork the sandbox here (https://codesandbox.io/s/smooth-scroll-2qfif). (!) Definitely not tested throughly, so use it at your own risk. (:) Would love feedbacks on breaking cases and strange behaviours. -- I'm currently working on an actual one that also solves a couple of webflow problems regarding position sticky and while scrolling animations but that's not happening anytime soon. I'll post on twitter when (and if) it's to a publishable state. This one does not. But position sticky is horrible anyway. šŸ‘€
smoothscrollsmoothscrollbardragsmoothscrollscrolleffectslocomotive-scroll

More by Federico

See profile