Hoverable
Mixin
internal
This mixin provides mouse hover tracking.
class Tracker extends Base.mixin(Hoverable) {
hoverEnter(leaving) {
// this.hoverTarget has been entered from "leaving"
// this.hoverTarget will never be null, but leaving may be null
}
hoverLeave(leaving) {
// this.hoverTarget has been entered from "leaving"
// this.hoverTarget may be null, but leaving will never be null
}
hoverMove(event) {
// called when a mousemove is made within a hover target
// this.hoverTarget will never be null
}
}
let tracker = new Tracker({
hoverRootElement : document.body,
hoverSelector : '.hoverable'
});
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
A CSS class to add to the target element to enable CSS animations. This class is added after calling hoverEnter.
-
A CSS class to add to the target element.
-
The number of milliseconds to delay notification of changes in the hoverTarget.
-
This property is a string containing one character for each edge that is hoverable. For example, a value of "tb" indicates that the top and bottom edges are hoverable.
-
The current element that the cursor is inside as determined by
mouseoverandmouseout. Changes in this config trigger re-evaluation of the hoverSelector to determine if there is a hoverTarget. -
An element to ignore. Mouse entry into this element will not trigger a change in either of the hoverElement or hoverTarget values.
-
A CSS class to add to the root element.
-
A selector for the closest API to determine the actual element of interest. This selector is used to process changes to the hoverElement to determine the hoverTarget.
-
The currently active hover target. This will be the same as hoverElement unless there is a hoverSelector.
-
Set to
trueto include tracking ofmousemoveevents for the active hoverTarget. This is required for the hoverMove method to be called. -
A string value containing one character per active edge (e.g., "tr").
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of Hoverable class, or subclass thereof.
-
Identifies an object as an instance of Hoverable class, or subclass thereof.