![]() ![]() You can download the files directly from GitHub. Otherwise, use the version with polyfills. If you're including your own polyfills or don't want to enable this feature for older browsers, use the standalone version. There are two versions of Smooth Scroll: the standalone version, and one that comes preloaded with polyfills for closest(), requestAnimationFrame(), and CustomEvent(), which are only supported in newer browsers. The src directory contains development code. □Ĭompiled and production-ready code can be found in the dist directory. Want to learn how to write your own vanilla JS plugins? Check out my Vanilla JS Pocket Guides or join the Vanilla JS Academy and level-up as a web developer. There's a native CSS way to handle smooth scrolling that might fit your needs. ![]() Quick aside: you might not need this library. Getting Started | Scroll Speed | Easing Options | API | What's new? | Known Issues | Browser Compatibility | License Learn how to animate scrolling to anchor links with one line of CSS, and how to prevent anchor links from scrolling behind fixed or sticky headers.Ī lightweight script to animate scrolling to anchor links. This plugin has run its course, and the browser now offers a better, more feature rich and resilient solution out-of-the-box. It can do things this plugin can't (like scrolling to anchor links from another page), and addresses bugs and limitations in the plugin that I have never gotten around to fixing. Smooth Scroll is, without a doubt, my most popular and widely used plugin.īut in the time since I created it, a CSS-only method for smooth scrolling has emerged, and now has fantastic browser support.
0 Comments
Leave a Reply. |