cursor-direction

1.0.1 • Public • Published

cursor-direction

cursor-direction on a DOM element.

Install

$ npm install --save cursor-direction

Demo

demo

Usage

const cursorDirection = require('cursor-direction');
 
// Example
element.addEventListener('mouseover', function (event) {
    cursorDirection(event, this); //=> 'TOP | RIGHT | BOTTOM | LEFT'
}, false);

API

cursorDirection(event, domElement)

event

Type: Event

MouseEvent

domElement

Type: DOMElement

Element of interest.

License

MIT © Hemanth.HM

Package Sidebar

Install

npm i cursor-direction

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • hemanth