npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

cursor-direction

1.0.1

@hemanth

npmHomeRepoSnykSocket
Downloads:3
$ npm install cursor-direction
DailyWeeklyMonthlyYearly

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