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?

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!
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...