Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/behnammodi/xwiper

swipe handler
https://github.com/behnammodi/xwiper

javascript

Last synced: 19 days ago
JSON representation

swipe handler

Awesome Lists containing this project

README

        

# Xwiper

[![NPM](https://nodei.co/npm/xwiper.png)](https://nodei.co/npm/xwiper/)

[![install size](https://packagephobia.now.sh/badge?p=xwiper)](https://packagephobia.now.sh/result?p=keal) [![dependencies](https://david-dm.org/uxitten/xwiper.svg)](https://david-dm.org/uxitten/xwiper.svg)


Version


License


Downloads

Swipe handler, support all browser

# Install

```npm
npm install xwiper --save
```

# How to use

```javascript
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

```javascript
const slider = document.querySelector('.slider');
const xwiper = new Xwiper(slider);
```