onclick

A click controller for mouse & touch.

MIT 4 个版本
安装
npm install onclick
yarn add onclick
pnpm add onclick
bun add onclick
README

onClick.js Build 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

版本列表
0.1.0 2014-03-26
0.0.3 2014-03-18
0.0.2 2014-03-11
0.0.1 2014-02-23