1.0.3 • Published 2 years ago

swipelistener-js v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

swipelistener-js

Small JS plugin to handle swipe gestures.

Demo

Install

$ yarn add swipelistener-js
import Swipe from 'swipelistener-js/src/main'

const swipe = new Swipe(el, options)
swipe.init()

function up() {
  printText('Swipe up')
}

swipe
  .on('swipeup', up)
  .on('swipedown', () => {
    printText('Swipe down')
  })

swipe.off('swipeup', up)

Options

Standart options

{
  moveCallbacks: false,
  resistance: 0,
}

Methods

swipe.on(eventName, callback)
swipe.off(eventName, callback)
swipe.destroy() 

Events names

  • swipeup
  • swipedown
  • swipeleft
  • swiperight
  • moveup
  • movedown
  • moveleft
  • moveright
1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago