Colour Animation.

 Colour Animation using button
<html>
<head>
<title>Colour Animation using button
</title>
<script language=javascript>
    function f1()
{
    document.bgColor="red"
    document.fgColor="aqua"
    window.setTimeout("f2()",800)
}
    function f2()
{
    document.bgColor="violet"
    document.fgColor="purple"
    window.setTimeout("f3()",800)
}
    function f3()
{
    document.bgColor="purple"
    document.fgColor="orange"
    window.setTimeout("f4()",800)
}
    function f4()
{
    document.bgColor="orange"
    document.fgColor="blue"
    window.setTimeout("f5()",800)
}
    function f5()
{
    document.bgColor="hotpink"
    document.fgColor="yellow"
    window.setTimeout("f6()",800)
}
    function f6()
{
    document.bgColor="yellow"
    document.fgColor="brown"
    window.setTimeout("f7()",800)
}
    function f7()
{
    document.bgColor="brown"
    document.fgColor="white"
    window.setTimeout("st()",800)
}
    function st()
{
    document.bgColor="white"
    document.fgColor="green"
}
</script>
</head>
<body>
<h1 align=center>Colour Animation using button</h1>
<br>
<center>
<input type=button name=b1 value="Start Colour Animation" onClick=f1();>
</center>
</body>
</html>

Colour Animation without using button
<html>
<head>
<title>Colour Animation without button
</title>
<script language=javascript>
    function f1()
{
    document.bgColor="red"
    document.fgColor="aqua"
    window.setTimeout("f2()",800)
}
    function f2()
{
    document.bgColor="violet"
    document.fgColor="purple"
    window.setTimeout("f3()",800)
}
    function f3()
{
    document.bgColor="purple"
    document.fgColor="orange"
    window.setTimeout("f4()",800)
}
    function f4()
{
    document.bgColor="orange"
    document.fgColor="blue"
    window.setTimeout("f5()",800)
}
    function f5()
{
    document.bgColor="hotpink"
    document.fgColor="yellow"
    window.setTimeout("f6()",800)
}
    function f6()
{
    document.bgColor="yellow"
    document.fgColor="brown"
    window.setTimeout("f7()",800)
}
    function f7()
{
    document.bgColor="brown"
    document.fgColor="white"
    window.setTimeout("st()",800)
}
    function st()
{
    document.bgColor="white"
    document.fgColor="green"
}
</script>
</head>
<body onLoad=f1();>
<h1 align=center>Colour Animation without button</h1>
</body>
</html>

Comments

Popular posts from this blog

Use of CSS without frames

ASP.net code to display a report of client IP address,browser information etc.

Prime Number