Twine Version: 1.4.2
Story Format: Sugarcube2
Author: total noob
I’m trying to get the text on the page to hide itself sequentially after clicking a button (it has to be a button for the UI to look right) which follows a link to a new passage, but before the link is actually followed. (so it looks like the text is disappearing gradually, and then the next passage loads)
I’m sure I’m doing something stupid - I’m getting it to display itself sequentially when the passage loads using document.addEventListener(“load”, showText()) - showText() is a function that cycles through a set of span elements and sets style.visibility to visible, using setTimeout to make them appear in sequence.
I’ve written a similar function which successfully hides the span elements in sequence when I attach it to an HTML button (which doesn’t follow a link), but I can’t find a way to attach it to a Sugarcube button which does follow a link.
Any help gratefully received.