Skip to content
swipe handler
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.npmignore
.prettierignore
.prettierrc
LICENSE
README.md
babel.config.js
index.js
package-lock.json
package.json

README.md

Xwiper

NPM

install size dependencies

Version License Downloads

Swipe handler, support all browser

Install

npm install xwiper --save

How to use

import Xwiper from 'xwiper';

const xwiper = new Xwiper('.slider');

xwiper.onSwipeLeft(() => console.log('swipe left'));

xwiper.onSwipeRight(() => console.log('swipe right'));

xwiper.onSwipeUp(() => console.log('swipe up'));

xwiper.onSwipeDown(() => console.log('swipe down'));

xwiper.onTap(() => console.log('tap'));

// Remove listener
xwiper.destroy();

Advance

You can use element instance

const slider = document.querySelector('.slider');
const xwiper = new Xwiper(slider);
You can’t perform that action at this time.