|
Changing
Background Color Automatically
You can use this JavaScript to
Change the Back Ground color automatically.
<HTML>
<HEAD>
<TITLE>Automatic Color Change of Back
Ground</TITLE>
<SCRIPT LANGUAGE=JAVASCRIPT>
var bg=new Array ("red" , "white" ,
"Blue")
var thisbg=0
var bgcnt=3
function Autobg()
{
if ( thisbg == bgcnt)
{
thisbg=0
}
else
{
thisbg++
}
document.bgcolor=bg(thisbg)
setTimeout("Autobg()",2*1000)
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR ="RED" onload = "Autobg()
" >
</BODY>
</HTML>
|