Skip to content

Instantly share code, notes, and snippets.

@dallinbryce
Last active August 29, 2015 14:12
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 dallinbryce/138319d1ed30a56e8794 to your computer and use it in GitHub Desktop.
Save dallinbryce/138319d1ed30a56e8794 to your computer and use it in GitHub Desktop.
Script that randomly changes the background color for a webpage.
(function () {
"use strict";
function changeColor() {
var b = Math.floor(Math.random() * 16777215).toString(16);
b = "#" + ("000000" + b).slice(-6);
document.bgColor = b;
}
setInterval(changeColor, 150);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment