A click controller for mouse & touch.
JavaScript CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
examples
src
test
.gitignore
.travis.yml
Gruntfile.js
README.md
package.json

README.md

onClick.js Build Status Dependency Status

A click controller for mouse & touch.

  • Prevents 300ms delay on touch
  • Touch interactions like scrolling work as expected
  • Handles devices that have both touch and mouse
  • Delegates events for efficiency

Installation

npm install onclick

A jQuery-like selector library is required:

  • jQuery 1.4.3+
  • Zepto

Usage

onClick({
    '#element': function(e) {
        alert("I was clicked!");
    }
});

onClick('.myclass', function() {

});

Check out a live example.

Development

To Build: grunt build

To Develop: grunt watch

To Test: npm test