Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.
/ eventlistener Public archive

Super-simple wrapper around addEventListener and attachEvent (old IE). Does not handle differences in the Event-objects.

License

Notifications You must be signed in to change notification settings

finn-no/eventlistener

Repository files navigation

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) {});

About

Super-simple wrapper around addEventListener and attachEvent (old IE). Does not handle differences in the Event-objects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published