|
Place this script in the head of the document.
<Html>
<Head>
<title>Changing Background colors</title>
<script language=javascript>
<!-- Hide script from old browsers
Var bGs = new Array ("gray", "orange", blue",
"black")
var newBg = 0
var bgColors = 4
function rotateBg() {
if (document.images) {
newBG++
if (newBg ==bgColors) {
newBg = 0
}
document.bgColor=bGs [newBg]
setTimeout ("rotateBg() ", 3*1000)
}
}
// end hiding script from old browsers -->
</script>
<Body bgcolor=white onload="rotateBg()"></body>
</html>
Click here
to see it in action.
|