Skip to content

Instantly share code, notes, and snippets.

@perryn
Created May 17, 2012 04:26
Show Gist options
  • Select an option

  • Save perryn/2716352 to your computer and use it in GitHub Desktop.

Select an option

Save perryn/2716352 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
pages = [
"http://google.com",
"http://reddit.com",
"http://xkcd.com"
]
index = 0;
function cycle() {
index = index % pages.length;
$('#page_frame').attr("src",pages[index])
index++;
}
$(document).ready(function() {
cycle();
setInterval(function() {
cycle();
}, 10000);
});
</script>
</head>
<body>
<iframe id="page_frame" src ="" width="100%" height="100%">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment