new Tooltip(element, options)
- Source:
Parameters:
| Name | Type | Description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
HTMLElement | DOM element for component instantiation and scope |
|||||||||||||||||||||
options |
Object |
Properties
|
Classes
Methods
clearHideTimeout()
- Description:
Cancel a previously scheduled hide.
- Source:
destroy()
- Description:
Destroy component.
- Source:
displayTooltip(trigger)
- Description:
Display tooltip
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
trigger |
HTMLElement |
getOrCreatePopup(trigger) → {HTMLElement}
- Description:
Return the popup element linked to a trigger, creating it if needed. This allows triggers added to the DOM after init() to work correctly.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
trigger |
HTMLElement |
Returns:
popup
- Type
- HTMLElement
handleFocusIn(e)
- Description:
Handle focusin event.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
e |
Event |
handleFocusOut()
- Description:
Handle focusout event.
- Source:
handleKeyboardGlobal(e)
- Description:
Handles global keyboard events, triggered outside of the tooltip.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
e |
Event |
handleMouseOut(e)
- Description:
Handle mouseout event.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
e |
Event |
handleMouseOver(e)
- Description:
Handle mouseover event (delegated).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
e |
Event |
hideTooltip()
- Description:
Hide tooltip
- Source:
init()
- Description:
Initialise component.
- Source:
positionTooltip(trigger, popup)
- Description:
Position tooltip relative to the trigger element.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
trigger |
HTMLElement | |
popup |
HTMLElement |
scheduleHide()
- Description:
Schedule a delayed hide, giving the mouse time to cross the gap between the trigger and the tooltip without closing it prematurely.
- Source:
(static) autoInit(root) → {Tooltip}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
root |
HTMLElement | DOM element for component instantiation and scope |
Returns:
An instance of Tooltip.
- Type
- Tooltip