0.1.5 • Published 7 years ago

is-pointer-near v0.1.5

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

is-pointer-near Build Status

Check if pointer is near the element

Install

npm install --save is-pointer-near

Usage

import isPointerNear from 'is-pointer-near';

document.addEventListener('mousemove', event => {
  const el = document.querySelector('.hello');
  isPointerNear(el, event, 25); // true if pointer near the el
}, false);

API

isPointerNear(element, event, distance)

Return true if pointer is within distance from element

element

Type: element

DOM element.

event

Type: object

Pointer event.

distance

Type: number
Default: 50

Distance to the element.

Related

License

MIT

0.1.5

7 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

9 years ago

0.1.0

9 years ago