|
1 | 1 | # Smooth Scroll [](https://travis-ci.org/cferdinandi/smooth-scroll) |
2 | 2 | A lightweight script to animate scrolling to anchor links. Smooth Scroll works great with [Gumshoe](https://github.com/cferdinandi/gumshoe). |
3 | 3 |
|
4 | | -[View the Demo](https://codepen.io/cferdinandi/pen/wQzrdM) |
| 4 | +**[View the Demo on CodePen →](https://codepen.io/cferdinandi/pen/wQzrdM)** |
| 5 | + |
| 6 | +[Getting Started](#getting-started) | [Scroll Speed](#scroll-speed) | [Easing Options](#easing-options) | [API](#api) | [What's new?](#whats-new) | [Known Issues](#known-issues) | [Browser Compatibility](#browser-compatibility) | [License](#license) |
| 7 | + |
| 8 | +*__Quick aside:__ you might not need this library. There's [a native CSS way to handle smooth scrolling](https://gomakethings.com/smooth-scrolling-links-with-only-css/) that might fit your needs.* |
5 | 9 |
|
6 | 10 |
|
7 | 11 | <hr> |
@@ -296,14 +300,6 @@ scroll.cancelScroll(); |
296 | 300 |
|
297 | 301 | ***Note:*** *This does not handle focus management. The user will stop in place, and focus will remain on the anchor link that triggered the scroll.* |
298 | 302 |
|
299 | | -#### init() |
300 | | -Initialize Smooth Scroll. This is called automatically when you instantiate your `new SmoothScroll` object, but can be used to reinitialize your instance. |
301 | | - |
302 | | -```javascript |
303 | | -var scroll = new SmoothScroll(); |
304 | | -scroll.init('.some-selector'); |
305 | | -``` |
306 | | - |
307 | 303 | #### destroy() |
308 | 304 | Destroy the current initialization. This is called automatically in the `init` method to remove any existing initializations. |
309 | 305 |
|
@@ -333,28 +329,7 @@ If you have multiple fixed headers, pass in the last one in the markup. |
333 | 329 |
|
334 | 330 |
|
335 | 331 |
|
336 | | -## Working with the Source Files |
337 | | - |
338 | | -If you would prefer, you can work with the development code in the `src` directory using the included [Gulp build system](http://gulpjs.com/). This compiles, lints, and minifies code. |
339 | | - |
340 | | -### Dependencies |
341 | | -Make sure these are installed first. |
342 | | - |
343 | | -* [Node.js](http://nodejs.org) |
344 | | -* [Gulp](http://gulpjs.com) `sudo npm install -g gulp` |
345 | | - |
346 | | -### Quick Start |
347 | | - |
348 | | -1. In bash/terminal/command line, `cd` into your project directory. |
349 | | -2. Run `npm install` to install required files. |
350 | | -3. When it's done installing, run one of the task runners to get going: |
351 | | - * `gulp` manually compiles files. |
352 | | - * `gulp watch` automatically compiles files when changes are made and applies changes using [LiveReload](http://livereload.com/). |
353 | | - |
354 | | - |
355 | | - |
356 | | - |
357 | | -## Migrating to Smooth Scroll 15 from Older Versions |
| 332 | +## What's new? |
358 | 333 |
|
359 | 334 | Scroll duration now varies based on distance traveled. If you want to maintain the old scroll animation duration behavior, set the `speedAsDuration` option to `true`. |
360 | 335 |
|
|
0 commit comments