Last updated: 5 Apr 20 13:54:09 (UTC)
Toggle Hide Display Text
Basically, use the <
-
Set a variable to “off” (in the example, $toggletext).
-
Put a with an ID (in the example, “displaytext"
-
Use the link macro to define the link (“show text”).
-
In the link macro, put an if/else that replaces the span (<<replace “#displaytext”>>) and toggles the variable to “on”.
EXAMPLE (PLACE IN PASSAGE):
<
<span id=“displaytext">
<<link “show text">>
<<if $toggletext == “off”>>
<<replace “#displaytext”>>SHOW THIS TEXT WHEN LINK IS CLICKED
<>
<<set $toggletext to “on”>>
<
I also did this in a link that cycles through images: <<link “snapshot”>> <<if $snapct == 0>> <<set _pic to “[img[ELC1.png]]”>> <<set $snapct += 1>> <<elseif $snapct == 1>> <<set _pic to “[img[ELC2.png]]”>> <<set $snapct += 1>> <<elseif $snapct == 2>> <<set _pic to “[img[ELC3.png]]”>> <<set $snapct += 1>> <<elseif $snapct == 3>> <<set _pic to “”>> <<set $snapct to 0>> <> <<replace “#img”>>_pic<> <>
Then, where the text or image should appear: