swipepackage
v1.0.1
Published
An npm package for making scrollable divs scroll horizontally and vertically
Downloads
6
Readme
SwipePackage
An npm package that let's you swipe scroll-able divs horizontally and vertically. This package exposes two methods
- swipeHorizontally
- swipeVertically
Installation
To use this package, you have to install it like every other package. To install it use the command below
npm install swipePackage
Getting started
After successfull installation of the package, you can use the two methods above by either importing the package or requiring it. An example of importing it is the code snippet below
import { swipeVertically, swipeHorizontally } from 'swipepackage';
An example of requiring it is the code snippet below
const swipePackage = require('swipepackage);
const {swipeVertically,swipeHorizontally} = swipePackage;
Using the package
The two methods of the package accepts two arguments.
- the DOM element (the parent element or in other words the container of your swipe elements)
- the speed at which you want them to swipe. Below is an example