vUX / ToolTip / v4.1.0
One ToolTip, one class, twenty-four bars. Point at any of them: the tip rides the pointer, stays inside the window at both edges, and flips below when the top runs out (try the editor bar above).
tip-bar, amber tip
peak hours
class tip-tool, a second instance
Every chip on the stage is a member of one ToolTip (class tip-play). Change the
colours, switch HTML on, turn single members off and on, add members at runtime and
rewrite a title. The panel on the right shows what the module did to the first chip.
Press Tab into this row. Focusing a member shows its tip at the
member, blur hides it, and Esc dismisses it. A focus-opened tip
follows its member when the page scrolls; a pointer-opened one hides instead. The shown
member carries aria-describedby pointing at the tip.
The tip is fixed to the viewport and kept 4px inside the window. Point at the far left and
far right pins: the box is pushed in from the edge, while the arrow (the
--vtt-arrow-left custom property) keeps pointing at the pointer.
destroy() removes the listeners, the tip box and the generated stylesheet and
gives every member its title back, so the browser's own tooltip returns. A
destroyed instance cannot be initialized again: create a new one.
Each button below makes a call the module rejects and prints the Error it
throws. A rejected call changes nothing: the playground keeps its colours.