attach-dom-events
util to attach multiple dom events to an element
Last updated 6 years ago by mattdesl .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install attach-dom-events 
SYNC missed versions from official npm registry.

attach-dom-events

unstable

Utility to attach multiple dom events to an element. Uses dom-events.

var attach = require('attach-dom-events')

attach(element, {
	mousemove: function(ev) {
		//..
	},
	keydown: function(ev) {
		//..
	}
})

Usage

NPM

attach(element[, events])

attach.on(element[, events])

Attaches the dictionary of events to element, using the keys as event names for addEventListener.

The main exported method is the same as on.

attach.off(element[, events])

Detaches all the given events.

attach.once(element[, events])

Attaches all the given events using once instead of on.

License

MIT, see LICENSE.md for details.

Current Tags

  • 1.0.0                                ...           latest (6 years ago)

1 Versions

  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (1)

Copyright 2014 - 2017 © taobao.org |