Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
button6.addEventListener('click', function() {
var red = 'red';
var halfRed = 'hsla(0, 100%, 25%, 1)';
var color = thing.style.color;
if (this.animating === undefined) {
this.animating = false;
}
if (this.animating === true) {
return;
}
this.animating = true;
thing.style.color = red;
setTimeout(function() {
thing.style.color = halfRed;
}, 500);
setTimeout(function() {
thing.style.color = color;
this.animating = false;
}.bind(this), 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.