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).
- MooTools Core 1.2.3: Class.Extras, Element.Event (and their dependencies)
- MooTools More 1.2.3.1: Class.Binds (and its dependences)
new HoverGroup(options);
- options - (object) an object of key/value settings
- 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'].
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.
myHoverGroup.attachTo(elements[, detach]);
- 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.
- (object) - This instance of HoverGroup