I was playing with this idea a bit more and made some refinements:
1.) changed the css so the iframe(s) would take up the whole window
2.) moved the css for making the second iframe initially unseen from the script to the style section
3.) changed from document ready to to jQuery(window).load because I noticed that if one navigated to the page via the back button it got weird, using load instead of ready minimized this problem
4.) added the ability to detect and properly process addresses that include hashes
5.) compacted/cleaned up the code a bit
Code:<!DOCTYPE html>
<html>
<head>
<title>Rotate iFrame Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<style type="text/css">
html body {height: 100%; overflow: hidden;}
iframe {width: 100%; height: 100%; position: absolute; top: 0; left: 0; border-width: 0;}
#if_two {visibility: hidden;}
</style>
</head>
<body>
<div>
<iframe id="if_one" src=""></iframe>
<iframe id="if_two" src=""></iframe>
</div>
<script>
jQuery(window).load(function(){
var pages = [
{page: 'http://www.dynamicdrive.com/forums/', dur: 10000},
{page: 'http://www.dynamicdrive.com/forums/forumdisplay.php?2', dur: 5000},
{page: 'http://www.dynamicdrive.com/forums/forumdisplay.php?3', dur: 3000} //<-- no comma after last page object
], p = pl = pages.length, ciframe = -1, $ = jQuery;
while(--p > -1){
pages[p].hash = pages[p].page.split('#')[1] || '';
pages[p].hash = pages[p].hash? '#' + pages[p].hash : '';
pages[p].page = $('<a />', {href: pages[p].page.replace(pages[p].hash, '')}).get(0);
}
$('iframe').load(function(){
$('iframe').not(this).css({visibility: 'hidden'});
$(this).css({visibility: 'visible'});
setTimeout(loadIframe, pages[p].dur);
});
function loadIframe() {
var page = pages[(p = ++p % pl)].page;
page = [page.href, page.search? '&' : '?', 'bustcache=', new Date().getTime(), pages[p].hash].join('');
$('iframe').eq((ciframe = ++ciframe % 2)).attr('src', page);
}
loadIframe();
});
</script>
</body>
</html>

