Detect last slide from parent html when embedding storyline in an iframe
May 27, 2015
I'm hoping someone can help me. We're embedding the storyline content in an iframe in our site, and we would like to be able to detect when the user has reached the last frame of the storyline content so that the parent html can do something javascript-y like redirecting the user to a new page, or scrolling to a new section of the page.
We have done the "Publishing a Course for Web" thing and are hosting this content on the same server. The storyline content is being included on the page with this code: <iframe id="module_video" src="<filepath>"></iframe>
Do we need to construct some kind of trigger in the storyline editor? Or is there a way we can get the storyline object (like use getPlayer()) from the parent of the iframe and check a variable or something?
4 Replies
A JS trigger on your last slide with something like this might get it:
parent.yourCustomFunction();
You'd put a function in your parent window to catch this call and execute what you want to accomplish.
Hi, Tony, and welcome to the community! I see that Steve is helping you here, but I wanted to chime in and add that although we don't provide support for JavaScript coding, it may be helpful to take a look at this document on JavaScript Best Practices.
Thanks for the replies, Steve and Christie. I believe Steve's suggestion will work.
Sure thing, Tony, and glad to hear you got the assistance you needed! Thanks, Steve! :)
This discussion is closed. You can start a new discussion or contact Articulate Support.