0.11.0 • Published 10 months ago

scrrroll v0.11.0

Weekly downloads
14
License
MIT
Repository
github
Last release
10 months ago

Scrrroll

Simple smooth scrolling.

Install

npm install scrrroll

Example Setup

Javascript

import Scroll from 'scrrroll';

const destination = document.querySelector('.selector'); // Number or HTMLElement
const duration = 400; // Number
const easing = t => t; // Easing function

// Scroll to position/element
Scroll.to(destination, duration, easing).then(() => {});

// Scroll to the top
Scroll.toTop(duration, easing).then(() => {});

// Scroll to the bottom
Scroll.toBottom(duration, easing).then(() => {});

// Scroll an element into view
Scroll.intoView(destination, duration, easing).then(() => {});

// Scroll to the top of an element
Scroll.top(destination, duration, easing).then(() => {});

// Scroll an element into the center of the viewport
Scroll.center(destination, duration, easing).then(() => {});

// Scroll to the bottom of an element
Scroll.bottom(destination, duration, easing).then(() => {});

License

MIT License

0.11.0

10 months ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.0

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.0

7 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago