This package has been deprecated

Author message:

This is not being actively developed nor supported.

merged-hover-events

0.1.3 • Public • Published

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.

/**
 * 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

Package Sidebar

Install

npm i merged-hover-events

Weekly Downloads

1

Version

0.1.3

License

MIT

Last publish

Collaborators

  • eneko89