Using a non-Squiffy link to advance the story...

thetruespin

I have a button and, when I click it, I would like Squiffy to advance to a section of my choosing. However, this button is in the main HTML template, not Squiffy itself. Do any of our resident Javascript / JQuery experts know how to do this?


manowar

Hi thetruespin!

To access squiffy object in your html, you may modify the story.js. On var methods you add the following code:

getSquiffy: function () {
   return squiffy;
},

After this, in the html button can place the following property:

<input type="button" onClick='jQuery.fn.squiffy("getSquiffy").story.go("clicked");' value="Click me!">

Then, when you click the button, the history advance to clicked section.


thetruespin

Brilliant. Thank you.


Log in to post a reply.

Support

Forums