https://github.com/pixelunion/bc-scroll-link
https://github.com/pixelunion/bc-scroll-link
library
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/pixelunion/bc-scroll-link
- Owner: pixelunion
- License: mit
- Created: 2018-05-08T18:40:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T22:23:08.000Z (over 3 years ago)
- Last Synced: 2024-03-26T12:58:30.008Z (over 2 years ago)
- Topics: library
- Language: JavaScript
- Size: 539 KB
- Stars: 0
- Watchers: 17
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Bigcommerce Scroll Link Module
Scroll to the top or any ID / class
### Installation
```
npm i --save github:pixelunion/bc-scroll-link
```
### Usage
```
import $ from 'jquery';
import ScrollLink from 'bc-scroll-link';
new ScrollLink({
duration: 1000,
easing: 'swing'
});
```
### Options
`duration`:
the scroll duration in milliseconds.
`easing`:
easing (only 'swing' and 'linear' available by default).
`delay`: delay before scrolling.
`updateHash`: (defaults to `true`) add the target to the URL? Set to `false` if targeting classes instead of IDs.
### Methods
`scrollToContent(target)`: Scroll to a target without using an anchor / button.
### Some sample markup
```
Top
Jump to: Some Section
```