2.0.2 • Published 7 years ago

swipeitlikeyoumeanit v2.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

swipeitlikeyoumeanit

Detect swipe actions for top, bottom, left and right directions

Getting Started

Prerequisites

npm

Installing

Download

npm install swipeitlikeyoumeanit

Import it

import swipeitlikeyoumeanit from 'swipeitlikeyoumeanit';

Instanciate it with any DOM element, and a optional number corresponding to the sensibility. (How much you must move to trigger the event.) Default to 0.

var mySwiper = swipeitlikeyoumeanit(document, 50);

Bind the callbacks

function left() {
}

function top() {
}

function bottom() {
}

function right() {
}

mySwiper.on('left', left);
mySwiper.on('right', right);
mySwiper.on('top', top);
mySwiper.on('bottom', bottom);

Unbind the callback

mySwiper.off('left');

Get rid of it

mySwiper.dispose();
2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago