iframe to target specific location of a web page

Aug 22, 2019

I would like to target a video on another website in my Storyline course and would like to have the video centered in my SL page. Can anyone offer the iframe instructions to do this? For example, the video is ___ pixels from the top and ___ pixels from the left of the page. I want the video to appear in the center of the SL page without the user having to scroll down to it. I've seen these instructions in the past but haven't been successful finding them.

Thanks!

3 Replies
OWEN HOLT

I'm going to post this here Lu so I can find it and try it later:
var myIframe = document.getElementById('iframe');
  myIframe.onload = function () {
  myIframe.contentWindow.scrollTo(xcoord,ycoord);
};

 

Might run into a "same domain" issue but there appear to be some workarounds.
https://stackoverflow.com/questions/1192228/scrolling-an-iframe-with-javascript

 

This discussion is closed. You can start a new discussion or contact Articulate Support.