0 votes
by (160 points)
I'm trying to get a tooltip when I hover the mouse over a button or link, but would prefer to keep it in Twine code or HTML without going involving CSS or Javascript. Is there a way to do this? There's an existing system for images with [img[Tooltip|image]]. Does a similar one exist for other code?

1 Answer

+2 votes
by (44.7k points)
selected by
 
Best answer

You can just put a "span" around the link and set the "title" attribute to whatever you want the hover text to be, like this:

<span title="Hover text">[[test]]</span>

That should do the trick for most things.

by (160 points)
That works perfectly. Thanks so much.
by (159k points)

You can also use HTML Attributes to do the same with a HTML anchor element, however this will cause the related Passage Connection Arrow to disappear on the Passage Map if you are using one of the Twine (1.x or 2.x) applications.

<a data-passage="test" title="Hover text">Test</a>

 

...