HoverGroup 1.0

Keeps track of when the mouse enters and exits a group of elements, allowing for time for the mouse to pass between them (think dropdown menus).
Releases
Dependencies
-
core/1.2.4:
- Class.Extras
- Element.Event
-
more/1.2.4.2:
Class.Binds
How to use
Requires
Syntax
new HoverGroup(options);
Arguments
- options - (object) an object of key/value settings
Options
- onEnter - (function) callback fired when the mouse enters the group
- onLeave - (function) callback fired when the mouse leaves the group
- elements - (mixed) collection of elements, a selector, an id, or an element to monitor for mouse enter/leave behavior
- delay - (integer) time (in ms) alloted for the mouse to leave one item in the group before it must enter another item in order to fire either the onEnter or onLeave events. Defaults to 300.
- start - (array) an array of events that can cause the onEnter event to fire. Defaults to ['mouseenter'] but could easily be, for example, ['click'].
- remain - (array) the events that keep the group open. Events that will keep the group from firing the onLeave event but only after the onEnter event has fired. If the start array doesn't include mouseenter, for example, you might want to set remains to ['mouseenter']. This would allow the user to click to open the group, but mouse around the group to keep it open. If start contains mouseenter, there's no need to specify it in the remain group. This value starts off as an empty array, as the default for start is ['mouseenter'].
- end - (array) the events that cause the onLeave event to fire. Defaults to ['mouseleave'].
Hovergroup Method Attachto
Attaches and detaches elements to the group. By default, the elements specified in the options are automatically attached, but you and add or remove items from the group at will.
Syntax
myHoverGroup.attachTo(elements[, detach]);
Arguments
- elements - (mixed) collection of elements, a selector, an id, or an element to attach to the group.
- detach - (boolean) if true the elements will be removed from the group.
Returns