cursor-direction on a DOM element.
$ npm install --save cursor-direction
const cursorDirection = require('cursor-direction');
// Example
element.addEventListener('mouseover', function (event) {
cursorDirection(event, this); //=> 'TOP | RIGHT | BOTTOM | LEFT'
}, false);
Type: Event
MouseEvent
Type: DOMElement
Element of interest.
MIT © Hemanth.HM