Created
July 25, 2015 08:14
-
-
Save faddah/26b7f05573503a314300 to your computer and use it in GitHub Desktop.
function from Lea Verou's version of Conway's Game Of Life
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
(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