Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Snowman: $(document).ready() equivalent when passage is rendered

$
0
0
I want to manipulate the DOM based on a condition stored in story.state, however I'm having trouble finding the right point to do it.
	$(document).on("ready", function() {
		$('.message').show();
	});

This doesn't work, presumably because the HTML is injected after the page has finished loading. The only way I can do it so far is with a set timeout.

I've also seen this,
	$(document).on("showpassage:after", function() {
		$('.message').show();
	});

but that seems to trigger before the message div has loaded too.

Viewing all articles
Browse latest Browse all 1844

Trending Articles