Login
Remember
IF Answers
Ask a Question

# Can I add dud links and tooltips in Squiffy with Javascript?

+2 votes
154 views
asked Mar 25 in Authoring by Natas (17 points)
recategorized Mar 27 by Alex
Dud links - A link that can be moused over but not clicked.
Tooltips - The box that appear when mouse over something.
These two things could be used in some interesting ways. I am wondering what must be done to do either of these features. Is doing this even possible?

- squiffy

## 1 Answer

+1 vote
answered Mar 27 by Alex (486 points)
selected Mar 27 by Natas
Best answer

You can use HTML, so you can manually add an <a> tag. If you use the squiffy-link CSS class, it will be styled the same as section and passage links.

To add a link that does nothing when clicked - just use onclick="return false". You can add a tooltip by setting the title attribute in the HTML tag.

This example brings all of the above together:

    This is a genuine [link], and this is a <a href="#"
    class="squiffy-link" onclick="return false"
    title="This is a tooltip">fake link</a>.

    [link]:
    You clicked the genuine link.

You can run this example here: http://docs.textadventures.co.uk/squiffy/scratchpad/?gistid=d2da6df246f60c7f9d4f&filename=links.squiffy

commented Mar 27 by Natas (17 points)
Amazing Alex! :) Thank you once again!

## Related questions

- Why does this Javascript not work in squiffy but will in a js editor
- How to add a random number generator in Squiffy?
- How to deal with large numbers in Squiffy?
- Is there a way to turn Squiffy passage links into a regular link for accessibility purposes?
- Random text in Squiffy

...