change iFrame src after x seconds + no return previous page

Discussion in 'Web Design and Development' started by paulz357, Feb 1, 2014.

  1. paulz357 macrumors newbie

    Feb 1, 2014
    Here is my code to change iframe src after x seconds.
    I need help to modify it so, when Page2 has loaded, user cannot return to Page1.

    Here is the code :

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript">
    var frames = Array('', 55,
    var i = 0, len = frames.length;
    function ChangeSrc()
    document.getElementById('frame').src = frames[i++];
    if (i >= len) return; // no more changing
    setTimeout('ChangeSrc()', (frames[i++]*1000));
    window.onload = ChangeSrc;
    <iframe src="" name="frame" id="frame" width="100%"height="100%></iframe>
  2. Code cookies macrumors member

    Dec 23, 2011
    Have you thought about having multiple iframes, and setting the css to
    and then using jquery show and hide?

    Let me know if you have any problems

Share This Page