Skip to content

Instantly share code, notes, and snippets.

@weapp
Forked from faddah/life.js
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weapp/702a71bb4b667d6add53 to your computer and use it in GitHub Desktop.
Save weapp/702a71bb4b667d6add53 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