Skip to content

Instantly share code, notes, and snippets.

@rmasters
Created September 11, 2012 20:07
Show Gist options
  • Save rmasters/3701640 to your computer and use it in GitHub Desktop.
Save rmasters/3701640 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<title>sucam</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
html, body { height: 100%; }
body { text-align: center; }
#cam { height: 100%; }
</style>
</head>
<body>
<img src="http://www.upsu.com/files/webcam_image_upsu.jpg" id="cam">
<script type="text/javascript">
var delay = 5 * 1000;
var cam = document.getElementById("cam");
var origsrc = cam.src;
var reload = function() {
cam.src = origsrc + "?" + new Date().getTime();
window.setTimeout(reload, delay);
};
window.setTimeout(reload, delay);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment