Skip to content

Instantly share code, notes, and snippets.

@radioslave
Created August 10, 2016 12:37
Show Gist options
  • Save radioslave/14eb0831b4da3e2ee0fa62d6620fe5d4 to your computer and use it in GitHub Desktop.
Save radioslave/14eb0831b4da3e2ee0fa62d6620fe5d4 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Test Layout</title>
<style type="text/css">
body, html
{
margin: 0; padding: 0; height: 100%; overflow: hidden;
}
#content
{
position:absolute; left: 0; right: 0; bottom: 0; top: 0px;
}
</style>
</head>
<body>
<div id="content">
<iframe id="rotate" name="rotate" width="100%" height="100%" frameborder="0" src="http://bbc.co.uk/iplayer"></iframe>
</div>
<script type="text/javascript">
var urls = ['http://bbc.co.uk/news', 'http://www.bbc.co.uk/sport/0/', 'https://www.danpurdy.co.uk/'];
var pos = 0;
next();
setInterval(next, 5000); // every 5 seconds
function next()
{
if(pos == urls.length) pos = 0; // reset the counter
document.rotate.location.href = urls[pos];
pos++;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment