# merged-hover-events

> Emulates 'mouseenter' and 'mouseleave' on a group of contiguous elements as if they were only one.

Latest version **0.1.3** (published 2016-04-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install merged-hover-events
pnpm add merged-hover-events
yarn add merged-hover-events
bun add merged-hover-events
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2016-04-07 |
| First published | 2016-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Eneko |
| Maintainers | eneko89 |
| Keywords | mouseenter, mouseleave, hover, events, group, contiguous, elements |

## Links

- npm: https://www.npmjs.com/package/merged-hover-events
- Repository: https://github.com/eneko89/merged-hover-events
- Homepage: https://github.com/eneko89/merged-hover-events#readme
- Issues: https://github.com/eneko89/merged-hover-events/issues
- npm.io page: https://npm.io/package/merged-hover-events

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2016-04-07
- 0.1.1 — 2016-03-31
- 0.1.0 — 2016-03-30

## README

merged-hover-events
===================

Emulates 'mouseenter' and 'mouseleave' on a group of contiguous elements as if
they were only one.

Usage
-----

Works both required as CommonsJS module (e.g., to bundle it with Browserify) in
node or in the browser.

```javascript

/**
 * Emulates 'mouseenter' and 'mouseleave' on a group of contiguous
 * elements as if they were only one.
 * 
 * @param  {Element[]}  elems        Group of contiguous Elements.
 * 
 * @param  {Function}   onEnter      Called when mouse enters the
 *                                   group of elements.
 * 
 * @param  {Function}   onLeave      Called when mouse leaves the
 *                                   group of elements.
 *
 * @param  {Boolean}    [exclusive]  If true, element groups cannot
 *                                   be hovered simultaneously. This
 *                                   means that in groups with elems
 *                                   in common, it won't notify all
 *                                   groups when entering or leaving
 *                                   the common elem, only the group
 *                                   defined in the first place. It
 *                                   defaults to false.
 */
function mergedHoverEvents(elems, onEnter, onLeave, exclusive) {
  ...
}

```

As a CommonsJS module it exports a function, and in a browser environment
declares mergedHoverEvents() function in the global scope.

Examples
--------

* [Simple usage](https://jsfiddle.net/Lrmdcvrk/11/)
* [With common elements](https://jsfiddle.net/bd0eporw/7/)

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