Crazy iFrames/JavaScript Problem
Jun 19, 2015
I have a Storyline variable, and based on the variable's value I need to open one of a set of web pages within Storyline. (Value A goes to Page A,Value B opens Page B, etc.)
Since the variable determines the URL I can't use the Web Object, so I had to use JavaScript. Now my novice-level coding skills are showing! As you can see from the image below, the iFrame I made appears in the parent window and behind the Storyline player.
Here is the code I'm using:
var player = GetPlayer();
var myGrade = player.GetVar("myGrade");
var myURL = "http://www.gsjia.org/z_points_" + myGrade;
console.log (myURL);
ifrm = document.createElement("IFRAME");
ifrm.setAttribute("src", myURL);
ifrm.style.width = 550+"px";
ifrm.style.height = 333+"px";
document.body.appendChild(ifrm);
Can anyone suggest a fix?
Thanks,
Sharon
1 Reply
Just saw this, a year later. It seems you could simply make A and B slides with webObjects pre-containing your urls. No Javascript needed. You vars could just trigger a slide jump, then it's all within SL. Hope this helps over a year later.
This discussion is closed. You can start a new discussion or contact Articulate Support.