1.0.0 • Published 5 years ago

touchevent.js v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

touchevent.js

TouchEvent is just a simple Script that will allow supporting touch event on all devices.

Demo: https://liimonx.github.io/TouchEvent/

Installation

npm

npm i TouchEvent.js

Now add it to your project:

Webpack

  import TouchEvent from 'TouchEvent'

HTML

  <script src="./TouchEvent/dist/TouchEvent.js"></script>

Usage

  new TouchEvent('.name_of_element', (event) => {
    console.log(event.startX)
    console.log(event.startY)
    console.log(event.endX)
    console.log(event.endY)
    console.log(event.walkX)
    console.log(event.walkY)
    console.log(event..target)
  })

Licence

Neon is under MIT licence