JSPM

cursor-direction

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q33369F
  • License MIT

cursor-direction on a DOM element.

Package Exports

  • cursor-direction

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cursor-direction) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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