Back to Index

Changing a Background

 

 

This script changes the color of the background.  You can use color names such as "red", "blue", "yellow" or the hex color index ID-- "#FFOOOO","#OO84A5","#FFFF10".

 

Place this part of the script between the <HEAD></HEAD> tags.

<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
bGrounds = new Array ("#DEBDDE","yellow","blue","#FFOOOO","red")
thisBG = 0
bgColorCount = bGrounds.length
function rotateBG() {
if (document.images) {
thisBG++
if(thisBG == bgColorCount) {
thisBG = 0
}
document.bgColor=bGrounds[thisBG]
setTimeout("rotateBG()",3*1000)
}
}
</SCRIPT>
 

Script instructions for <BODY> of the HTML Document

onLoad="rotateBG()"

Paste script between the <HEAD></HEAD> tags.

Paste script in the <BODY> tag of the HTML Document.


Copyright 2003 Ultimatephp.com