Skip to content

Instantly share code, notes, and snippets.

@incompl
Created June 26, 2015 22:13
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 incompl/588ced5990cac18644fa to your computer and use it in GitHub Desktop.
Save incompl/588ced5990cac18644fa to your computer and use it in GitHub Desktop.
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