https://github.com/behnammodi/xwiper
swipe handler
https://github.com/behnammodi/xwiper
javascript
Last synced: about 1 year ago
JSON representation
swipe handler
- Host: GitHub
- URL: https://github.com/behnammodi/xwiper
- Owner: behnammodi
- License: mit
- Created: 2018-08-27T04:14:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T03:18:55.000Z (over 3 years ago)
- Last Synced: 2024-10-29T10:08:34.970Z (over 1 year 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
[](https://nodei.co/npm/xwiper/)
[](https://packagephobia.now.sh/result?p=keal) [](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);
```