GitHub - git-antonyuk/SwipeEvents: Swipe Events helper 🛠 · GitHub
Skip to content

git-antonyuk/SwipeEvents

Folders and files

Repository files navigation

Swipe Events helper

Init sample

const el = document.querySelector('.el')
const swipeEvents = new SwipeEvents(el)

function prev () {
  console.log('prev')
}

function next () {
  console.log('next')
}

el.addEventListener('swipeRight', prev)
el.addEventListener('swipeLeft', next)

Destroy sample

el.removeEventListener('swipeRight', this.prev)
el.removeEventListener('swipeLeft', this.next)
swipeEvents.removeEventListener()

About

Swipe Events helper 🛠

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors