mouseleave

1.0.0 • Public • Published

mouseleave

mouseleave event emulation

mouseleave(element, fn)

var mouseleave = require('mouseleave');
var div = document.querySelector(...);
 
mouseleave(div, function(ev) {
    console.log('the mouse is here');
});

unbind

mouseleave returns a function you can use to no longer react to mouseleave events. Call this function and the previously bound event will be unbound.

var unbind = mouseleave(div, function(ev) {
    console.log('the mouse is here');
});
 
// will listen for mouseleave events
 
// call `unbind` to stop listening
unbind();

testing

$ npm run test-local

Then open the url it gives you in a local browser.

Licence

MIT

Readme

Keywords

Package Sidebar

Install

npm i mouseleave

Weekly Downloads

2

Version

1.0.0

License

none

Last publish

Collaborators

  • defunctzombie