Skip to content

Instantly share code, notes, and snippets.

@AndyGaskell
Created May 25, 2019 23:37
Show Gist options
  • Save AndyGaskell/9d8d5693d5cf99e31b783adc8c335246 to your computer and use it in GitHub Desktop.
Save AndyGaskell/9d8d5693d5cf99e31b783adc8c335246 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Fugly pager thing</title>
</head>
<body>
<script type='text/javascript'>
/* A list of URLs can be got from RegEx or this online tool http://tools.buzzstream.com/link-building-extract-urls */
var next_url = (function() {
/* make an array of the URLs to review */
var url_array = [
"https://bbc.co.uk/sport/football",
"https://www.bbc.co.uk/news",
"https://www.bbc.co.uk/news/technology",
];
var count = -1;
return function() {
var return_value = url_array[++count % url_array.length];
document.getElementById('current_url').innerHTML = return_value;
//alert(return_value);
return return_value;
}
}());
document.onkeydown = function (e) {
var keyCode = e.keyCode;
if(keyCode == 39) {
document.getElementById('my_iframe').src = next_url();
}
};
</script>
<button onclick="document.getElementById('my_iframe').src = next_url();">Next >></button> <span id="current_url"></span><br/>
<iframe src="https://cfs.scotlandphp.co.uk" id="my_iframe" height="850" width="1600"></iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment