Skip to content

npm-dom/simulate-touch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simulate-touch

Fire touch events when corresponding mouse events fire.

  • mousedown -> touchstart
  • mousemove -> touchmove
  • mouseup -> touchend

Install

$ npm install simulate-touch

Usage

var simulateTouch = require('simulate-touch')

simulateTouch(document.body)

document.body.addEventListener('touchstart', function () {
  console.log('touch start')
})

document.body.dispatchEvent([mousedown event])
// touch started

See test.js for more info.

Releases

No releases published

Packages

No packages published