Fast Background Rotator

[Total: 0    Average: 0/5]

This will rotate fast through background colors.

Body Code:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var pos = 10;
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
   }
}
var col=new initArray("4b","5b","8b","8b");
function stop() {
document.bgColor = '#FFFFFF';
clearTimeout(loopID);
}

function startIt() 
{
col[1]="red"
col[2]="yellowgreen"
col[3]="yellow"
col[4]="whitesmoke"
col[5]="white"
col[6]="wheat"
col[7]="violet"
col[8]="turquoise"
col[9]="tomato"
col[10]="thistle"
pos++;
if (pos<0||pos>10) {
pos = 0;
}
document.bgColor = col[pos];
loopID = setTimeout("startIt()",50);
}
// End -->
</SCRIPT>
<FORM>
<input type="button" value="Start" onClick="startIt()">
<input type="button" value="Stop" onClick="stop()">
</FORM>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *