2.0.2 • Published 3 years ago

slickscrolljs v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Slickscroll is a JavaScript library that makes momentum & parallax scrolling quick and painless

NPM version NPM license

View Demo: slickscroll.musabhassan.com

Download & Setup

Download

Manually download from Releases, from the dist directory, or npm.

npm

npm install --save slickscrolljs

Setup

This setup will just apply momentum scrolling to the body

ES6 import

import slickScroll from './slickscroll.es.min.js';

const slick = new slickScroll({
    root: "body"
});

HTML script tag

<script src="./slickscroll.min.js" type="text/javascript"></script>

<script type="text/javascript">

    let slick = new slickScroll.default({
        root: "body"
    });

</script>

Node require

const slickScroll = require('slickscrolljs');

const slick = new slickScroll.default({
    root: "body"
});

Hello World

The hello world will apply the momentum scrolling to the element you specify.

slick.momentumScroll({
    root: "body"
})

The overflow property of the root element will be overridden with auto upon initialization of slickscroll. If you wish to change overflow to anything else, you must modify it after the initialization.

Momentum scrolling applies to both x and y axis of an element. If you wish for an axis to not scroll, change it's overflow value to hidden after slickscroll initialization.

Example to hide overflow-x after initializing up slickscroll;

const slick = new slickScroll.default({
    root: "body"
});

document.body.style.overflowX = "hidden";

All the valid options aswell as documentation and Getting Started can be found in the docs directory.

Browser Support

BrowserVersion
Chrome61+
Edge80+
IE11
Firefox48+
Opera48+
Safari12+

Contributors

Musab-Hassan

License

MIT license.

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.2

3 years ago

1.2.3

4 years ago

1.3.1

3 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago