Skip to content

Commit

Permalink
Adding extras code
Browse files Browse the repository at this point in the history
  • Loading branch information
bethrobson committed Jul 23, 2014
1 parent adebbe5 commit 8e9b315
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions extras/timer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<html>
<head>
<title>Webville Lounge</title>
<script>

var dj = {
playsound: function() {
console.log("Playing ", this.sound);
},
sound: "bells"
};

var controller = {
timer: null,
start: function() {
this.timer = setInterval(dj.playsound.bind(dj), 1000);
},
stop: function() {
clearInterval(this.timer);
}
};

window.onload = function() {

//controller.start();

var startButton = document.getElementById("start");
startButton.onclick = function() {
controller.start();
};

var stopButton = document.getElementById("stop");
stopButton.onclick = function() {
controller.stop();
};
};

</script>
</head>
<body>
<button id="start">start</button>
<button id="stop">stop</button>
</body>
</html>

0 comments on commit 8e9b315

Please sign in to comment.