Last active
August 29, 2015 14:07
-
-
Save panchr/942efb61b8edab7fba00 to your computer and use it in GitHub Desktop.
Alternates through web page colors every 100ms
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 colorSpam () { | |
var colors = ["red", "blue", "green", "orange", "purple", "yellow"]; | |
function changeColor(i) { | |
i = i < colors.length ? i: 0; | |
document.body.style.backgroundColor = colors[i]; | |
setInterval(function () {changeColor(i + 1)}, 100); | |
} | |
changeColor(1); | |
}; | |
colorSpam(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment