/touch-polyfill

A touch polyfill that mimics touch events in mouse-only environments

Primary LanguageJavaScriptMIT LicenseMIT

touch-polyfill

A polyfill for the touch event model. Allows for standardizing user input using touch events as opposed to mouse events or pointer events* (IE10+)

*not yet supported

Installation

npm install rvangundy/touch-polyfill --save

Usage

The touch polyfill is intended to be used with browserify.

Include the touch-polyfill at the beginning of your application code.

require('touch-polyfill');

It is then possible to register for touch events using standard event registration:

document.body.addEventListener('touchstart', function() { alert('touched!'); }, false);