![]() 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. Give smooth scrolling a shot in your next project! It's great fun to work with, extremely easy to implement, and provides a better overall experience for your users.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. ![]() Unfortunately for Apple users, Safari does not support his feature yet, however, there is a polyfill option available that will fill the gap and provide the functionality you're looking for. Smooth scrolling is available for use in most modern browsers. If you want to jump scroll, you can save yourself the extra code and use the window.scrollTo() method with X and Y values that we discussed earlier.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |