Color with button.html

<html>
<head>
<title>Color Annimation with button</title>
</head>
<body>
<center>
<script language=javascript>
function clr1()
{
document.bgColor="red"
document.fgColor="blue"
window.setTimeout("clr2()",800)
}
function clr2()
{
document.bgColor="aqua"
document.fgColor="yellow"
window.setTimeout("clr3()",800)
}
function clr3()
{
document.bgColor="orange"
document.fgColor="skyblue"
window.setTimeout("clr4()",800)
}
function clr4()
{
document.bgColor="pink"
document.fgColor="red"
window.setTimeout("clr5()",800)
}
function clr5()
{
document.bgColor="yellow"
document.fgColor="purple"
window.setTimeout("clr6()",800)
}
function clr6()
{
document.bgColor="purple"
document.fgColor="majenda"
window.setTimeout("clr7()",800)
}
function clr7()
{
document.bgColor="majenda"
document.fgColor="hotpink"
window.setTimeout("clr8()",800)
}
function clr8()
{
document.bgColor="hotpink"
document.fgColor="aqua"
window.setTimeout("clr1()",800)
}
</script>
</head>
<body bgcolor=aqua>
<h1>Event Driven Client Side Scripting Color With Botton</h1>
<input type=button name=b1 value="Start color annimation" onClick=clr1();><br>
<input type=button name=b1 value="Start color annimation" onMouseOver=clr1();><br>
</body>
</html>





<html>
<head>
<title>Color Annimation without button</title>
</head>
<body>
<center>
<script language=javascript>
function clr1()
{
document.bgColor="red"
document.fgColor="blue"
window.setTimeout("clr2()",800)
}
function clr2()
{
document.bgColor="aqua"
document.fgColor="yellow"
window.setTimeout("clr3()",800)
}
function clr3()
{
document.bgColor="orange"
document.fgColor="skyblue"
window.setTimeout("clr4()",800)
}
function clr4()
{
document.bgColor="pink"
document.fgColor="red"
window.setTimeout("clr5()",800)
}
function clr5()
{
document.bgColor="yellow"
document.fgColor="purple"
window.setTimeout("clr6()",800)
}
function clr6()
{
document.bgColor="purple"
document.fgColor="majenda"
window.setTimeout("clr7()",800)
}
function clr7()
{
document.bgColor="majenda"
document.fgColor="hotpink"
window.setTimeout("clr8()",800)
}
function clr8()
{
document.bgColor="hotpink"
document.fgColor="aqua"
window.setTimeout("clr1()",800)
}
</script>
</head>
<body bgcolor=aqua>
<h1>Event Driven Client Side Scripting Color Without Botton</h1>
</body>
</html>






No comments:

Post a Comment