Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Showing text after timer in Snowman

I just started using Snowman and have not had any trouble with basic branching and conditionals (I'm an experienced programmer) but I just tried to get some text to show after a timer and it isn't working. Help?

what I tried:
You died.

<%
setTimeout(function(){
print("main");
}, 1000);
%>

Comments

  • I figured out how to do this: the passage is only constructed when you first go to it, so print() after a timer does nothing. Instead I can make some hidden text and show it on a timer, like so:
    You died.
    
    [
    [[Try again!|main]]
    ]{-#delayed}
    
    <%
    setTimeout(function(){
    	$("#delayed").show();
    }, 1000);
    %>
    

    Now I'm thinking I should add a small note about that to the documentation; is that okay? I'm thinking right after this line in the readme:

    And if you would like the <div> to start hidden, e.g. display: none, put a minus sign (-) as the first character after the curly brackets.

    I'll mention "(to do things like showing invisible text after waiting for a timer)"
Sign In or Register to comment.