component-event
Event binding component
Last updated 4 years ago by tootallnate .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install component-event 
SYNC missed versions from official npm registry.

event

Element event binding component.

Installation

$ component install component/event

Example

var events = require('event');
var a = document.querySelector('a');

function onclick(e) {
  e.preventDefault();
  console.log(e.target);
  events.unbind(a, 'click', onclick);
}

events.bind(a, 'click', onclick);

API

.bind(el, type, callback, [capture])

Bind to el's event type with callback, returns the callback passed.

.unbind(el, type, callback, [capture])

Unbind el's event type callback, returns the callback passed.

License

MIT

Current Tags

  • 0.2.0                                ...           latest (4 years ago)

3 Versions

  • 0.2.0                                ...           4 years ago
  • 0.1.4                                ...           7 years ago
  • 0.1.3                                ...           7 years ago
Downloads
Today 9
This Week 1,279
This Month 618
Last Day 609
Last Week 3,559
Last Month 13,882
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (112)

Copyright 2014 - 2016 © taobao.org |