Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Special Interests > Visual Media > Web Design and Development

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 1, 2014, 08:33 PM   #1
paulz357
macrumors newbie
 
Join Date: Feb 2014
change iFrame src after x seconds + no return previous page

Hello,
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MyFile</title>
<script type="text/javascript">
var frames = Array('http://www.mydomain.com/files/Page1', 55,
'http://www.mydomain.com/files/Page2');
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;
</script>
</head>
<body>
<iframe src="" name="frame" id="frame" width="100%"height="100%></iframe>
</body>
</html>
paulz357 is offline   0 Reply With Quote
Old Feb 25, 2014, 12:27 PM   #2
Code cookies
macrumors newbie
 
Join Date: Dec 2011
Location: UK
Have you thought about having multiple iframes, and setting the css to
Quote:
display:none;
and then using jquery show and hide?

Let me know if you have any problems
Code cookies is offline   0 Reply With Quote

Reply
MacRumors Forums > Special Interests > Visual Media > Web Design and Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:19 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC