topo
Topo is a smol script for cursor-bound tooltips — sans jQuery and in less than 30 lines of 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, then create and initialise a Topo object.
<div data-tip="mice are nice">🐁</div>
<script>new Topo().init()</script>
🐁