avanier's banner

topo

Topo is a smol script for cursor-bound tooltips sans jQuery and in less than 50 lines of vanilla JS. The name comes from the Italian word for “mouse”.

Topo adds event listeners to elements with a data-tip attribute. A temporal <span> appears when the cursor hovers over any of the aforementioned elements.

To use, include the script and initialise a Topo object.

<div data-tip="mice are nice">&#128001;</div>
<script>new Topo()</script>
🐁