In a response to a person who once asked if it was possible to create a script that randomly changes the text color without the need of using arrays, here is one of many possible scripts that will accomplish that.
It is a very basic script that uses 2 functions with simplicity being its main feature. I am sure there could be better scripts out there but I doubt it. Just kidding!
Warning---the oddest colors may appear at times.
Here is the script:
<HTML>
<HEAD>
<!-- Minus AutoDato -->
<TITLE>Changing Color TextText</TITLE>
</HEAD>
<BODY>
<div id="sample" style="width:100%;color:"><B>Changing Color</B></div>
<script language="JavaScript1.2">
f=0
function mixNumber()
{
now = new Date();
seed = now.getSeconds();
var i=Math.floor(Math.random(seed)*256)
var t=Math.floor(Math.random(seed)*256)
var k=Math.floor(Math.random(seed)*256)
while(Math.floor(Math.random(seed)*256==0))
{
Math.floor(Math.random(seed)*256)
}
hex1=k
hex2=i
hex3=t
fadetext();
}
function fadetext(){
if(hex1>0)
{
changeSpeed=1500//Vary speed of color change;1000=1 second
sizeOfFont=40//Change font size
document.getElementById("sample").style.color="rgb("+hex1+","+hex2+","+hex3+")";
document.getElementById("sample").style.fontSize=sizeOfFont
setTimeout("mixNumber()",changeSpeed);
}
else
{
mixNumber()
}
}
mixNumber();
</script>
</BODY>
</HTML>
Bookmarks