An open API service indexing awesome lists of open source software.

https://github.com/bigcommerce/themes-lib-scroll-link


https://github.com/bigcommerce/themes-lib-scroll-link

Last synced: 11 months ago
JSON representation

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
```