Flashing colors when opening page

by GOKILAVANI 2014-04-18 12:33:48

Flashing or changing colors when opening a page using javascript function.

function bgChanger (end) {
document.getElementsByTagName("body")[0].style.backgroundColor = "#" + end;
}
//red
setTimeout(function() { bgChanger("FF0000")}, 0);
//black
setTimeout(function() { bgChanger("000000")}, 100);
//purple
setTimeout(function() {bgChanger("AA00EE")}, 200);
//green
setTimeout(function() {bgChanger("00FF00")}, 300);
//blue
setTimeout(function() {bgChanger("0000FF")}, 400);
//gray
setTimeout(function() {bgChanger("CCCCCC")}, 500);
//white (pause)
setTimeout(function() {bgChanger("FFFFFF")}, 600);

Demo:
http://www.computerhope.com/j13e.htm
565
like
0
dislike
0
mail
flag

You must LOGIN to add comments