# is-inside-dom-element

> >

Latest version **1.0.2** (published 2018-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-inside-dom-element
pnpm add is-inside-dom-element
yarn add is-inside-dom-element
bun add is-inside-dom-element
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-11-22 |
| First published | 2018-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wle8300 |
| Maintainers | wle8300 |

## Links

- npm: https://www.npmjs.com/package/is-inside-dom-element
- Repository: https://github.com/wle8300/is-inside-dom-element
- Homepage: https://github.com/wle8300/is-inside-dom-element#readme
- Issues: https://github.com/wle8300/is-inside-dom-element/issues
- npm.io page: https://npm.io/package/is-inside-dom-element

## Dependencies (1)

- [lodash.throttle](https://npm.io/package/lodash.throttle.md) ^4.1.1

## Recent versions

- 1.0.2 (latest) — 2018-11-22
- 1.0.1 — 2018-11-22
- 1.0.0 — 2018-11-22

## README

# is-inside-dom-element

>

[![NPM](https://img.shields.io/npm/v/is-inside-dom-element.svg)](https://www.npmjs.com/package/is-inside-dom-element) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)


![screenshot](screenshot.gif)



## Description

Sometimes you need programmatic way to determine whether the mouse cursor is hovering above a DOM element. Instead of using <code>onmouseover</code> or <code>onmouseleave</code> this lib uses geometry to determine this.

It's a rudimentary implementation since it only works on rectangular DOM elements.



## Demo

https://wle8300.github.io/is-inside-dom-element



## Install

```bash
npm install --save is-inside-dom-element
```



## Usage

```
//calling
import isInside from 'is-inside-dom-element'

//usage
document.addEventListener('mousemove', (event) => {

  const element = document.getElementById('some-id')

  console.log(isInside(event.x, event.y, element))
})
```



## License

MIT © [wle8300](https://github.com/wle8300)

---
_Source: https://npm.io/package/is-inside-dom-element · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
