JAVASCRIPT-CHANGE BGCOLOR BY USING TIME
<html>
<head>
<title>bgcolor change by time </title>
<style type="text/css">
p{
line-height:40px;
color:#000000;
background-color:#00ff00;
}
</style>
<script language="JavaScript">
colors=new Array("red","orange","green","silver")
colorIndex=0
function changeColor() {
document.bgColor=colors[colorIndex]
colorIndex=(colorIndex+1) % colors.length
}
function startColorChange() {
setInterval("changeColor()",3000)
}
window.onload=startColorChange
</script>
</head>
<body bgcolor=white>
<p>the change the Bgcolor every 3 sec.</p>
</body>
</html>
<head>
<title>bgcolor change by time </title>
<style type="text/css">
p{
line-height:40px;
color:#000000;
background-color:#00ff00;
}
</style>
<script language="JavaScript">
colors=new Array("red","orange","green","silver")
colorIndex=0
function changeColor() {
document.bgColor=colors[colorIndex]
colorIndex=(colorIndex+1) % colors.length
}
function startColorChange() {
setInterval("changeColor()",3000)
}
window.onload=startColorChange
</script>
</head>
<body bgcolor=white>
<p>the change the Bgcolor every 3 sec.</p>
</body>
</html>
Comments
Post a Comment