Last updated: 5 Apr 20 13:54:09 (UTC)

Toggle Hide Display Text

Basically, use the <> macro to toggle it on and off (or between states) on each click.

  1. Set a variable to “off” (in the example, $toggletext).

  2. Put a with an ID (in the example, “displaytext"

  3. Use the link macro to define the link (“show text”).

  4. In the link macro, put an if/else that replaces the span (<<replace “#displaytext”>>) and toggles the variable to “on”.

EXAMPLE (PLACE IN PASSAGE): <><<set $toggletext to “off”>><>

<span id=“displaytext">

<<link “show text">> <<if $toggletext == “off”>> <<replace “#displaytext”>>SHOW THIS TEXT WHEN LINK IS CLICKED <> <<set $toggletext to “on”>> <> <<replace “#displaytext">><> <<set $toggletext to “off”>> <> <>

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: