This one line script fades the background color of a page nicely.
But if I try to apply the same thing to the font color of an element with this code:
it no longer fades, it just jumps to the last color value.
Why does it behave differently in the second snippet and how can I fade the color of text ?
Code:
for (i = 0; i < 256; i++)
{
document.bgColor = (i++) * 256 *256 + (i++) * 256;
}
Code:
for (i = 0; i < 256; i++)
{
document.getElementById("three").style.color = (i++) * 256 *256 + (i++) * 256;
}
Why does it behave differently in the second snippet and how can I fade the color of text ?