mouseleave

mouseleave shim utility

mouseleave

mouseleave event emulation

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

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();
$ npm run test-local

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

MIT