Skip to content

Instantly share code, notes, and snippets.

@faddah
Created July 25, 2015 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save faddah/26b7f05573503a314300 to your computer and use it in GitHub Desktop.
Save faddah/26b7f05573503a314300 to your computer and use it in GitHub Desktop.
function from Lea Verou's version of Conway's Game Of Life
(function() {
var buttons = {
next: $('button.next')
};
buttons.next.addEventListener('click', function() {
lifeView.next();
});
$('#autoplay').addEventListener('change', function() {
buttons.next.disabled = this.checked;
if(this.checked) {
lifeView.autoplay = this.checked;
lifeView.next();
} else {
clearTimeout(lifeView.timer);
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment