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

Similar Threads
thread Thread Starter Forum Replies Last Post
iPad: Safari briefly retains page from previous session Sir Ruben iPad 1 Nov 19, 2013 11:14 AM
Safari 7 is not reloading more previous page Daniva Mac Applications and Mac App Store 0 Oct 28, 2013 12:15 PM
Resolved: Return to Previous Page chattahoochee MacBook 2 Jun 16, 2013 12:58 AM
Change Safari's "Show the previous page" shortcut SuperKirby OS X 10.8 Mountain Lion 0 Mar 31, 2013 10:51 PM
Safari 6.0 - Going to previous page NYR99 Mac Applications and Mac App Store 5 Sep 27, 2012 12:43 PM

Forum Jump

All times are GMT -5. The time now is 08:01 PM.

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

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