Command Palette

Search for a command to run...

Hectal
Phase 8: Interaction
Data Visualization · Exercise 2 of 4 PreviousNext
Intermediate

Keep the tooltip on screen

The tooltip always opens to the right of the pointer, so near the right edge it sticks out of its box.

Make it open to the left of the pointer when there is no room on the right, and never let it leave the box.

What Check tests

  1. Near the left edge the tooltip is inside the box
  2. Near the right edge the tooltip is still inside the box
  3. Near the right edge the tooltip sits left of the pointer

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.