Created
September 13, 2015 13:03
-
-
Save ssx/71eec235778f25a4af65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Coffee Generator</title> | |
<style type="text/css"> | |
body { | |
background: #f3r3e3; | |
font-size: 40px; | |
text-align: center; | |
color: #000; | |
} | |
</style> | |
<script type="text/javascript"> | |
var names = new Array("Chris E", "Chris T", "Rob", "Scott", "Simon", "Tom"); | |
var timer; | |
function spinReel() | |
{ | |
RandomName = Math.round(Math.random()*(names.length-1)); | |
var change_box = document.getElementById('winner'); | |
change_box.innerHTML = names[RandomName]; | |
} | |
function startTimer() | |
{ | |
timer = setInterval ("spinReel();", 80); | |
setTimeout(stopTimer, 5000); | |
} | |
function stopTimer() | |
{ | |
clearInterval(timer); | |
var username = document.getElementById('winner').innerHTML; | |
} | |
</script> | |
</head> | |
<body onLoad="startTimer();"> | |
<h2 id="winner">hi</h2> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment