Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/behnammodi/xwiper
swipe handler
https://github.com/behnammodi/xwiper
javascript
Last synced: 19 days ago
JSON representation
swipe handler
- Host: GitHub
- URL: https://github.com/behnammodi/xwiper
- Owner: behnammodi
- License: mit
- Created: 2018-08-27T04:14:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T03:18:55.000Z (over 1 year ago)
- Last Synced: 2024-05-27T12:35:30.460Z (6 months ago)
- Topics: javascript
- Language: JavaScript
- Homepage:
- Size: 304 KB
- Stars: 25
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)
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);
```