0.0.1 • Published 10 years ago

eventlistener v0.0.1

Weekly downloads
200,341
License
MIT
Repository
github
Last release
10 years ago

eventlistener

Just a very simple wrapper around addEventListener with a stupid fallback to attachEvent. Does not handle the differences in Internet Exploreŕs events VS standard events.

Uses Universal Module Definition, so works with AMD, CommonJS or exposed as window.eventListener.

Build Status NPM

API

var eventListener = require('eventlistener');
function onLoad(evt) {};
eventListener.add(window, 'load', onLoad);
eventListener.remove(window, 'load', onLoad);

var el = document.getElementById('test');
eventListener.add(el, 'click', function (evt) {});