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