Animating the document background color after every defined interval

Rajesh_Kumar
Posted by Rajesh_Kumar under JavaScript category on | Points: 40 | Views : 352
<script language = "javascript" type="text/javascript">
function change_document_bg_color()
{
setTimeout("document.bgColor = 'blue'", 1000)
setTimeout("document.bgColor = 'pink'", 2000)
setTimeout("document.bgColor = 'yellow'", 2500)
setTimeout("document.bgColor = 'red'", 3000)
setTimeout("document.bgColor = 'cyan'", 4000)
}
</script>
//Now call above function on body onload event .

Comments or Responses

Login to post response