View Poll Results: How did you like my script?

Voters
3. You may not vote on this poll
  • exellent

    3 100.00%
  • better

    0 0%
  • good

    0 0%
  • it's OK

    0 0%
  • not so bad

    0 0%
  • bad

    0 0%
Results 1 to 5 of 5

Thread: DiScO Background

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2005
    Location
    America
    Posts
    51

    Default DiScO Background

    This is a disco background (background color change continuesly without deley) Here you can put this code to a .txt document and then rename the last extension to .htm or .html , if you don't know how to rename, then I will post that after that.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>

    <title>Your Title</title>
    <script language="JavaScript">
    <!--
    //you can assign the initial color of the background here
    r=255;
    g=255;
    b=255;
    flag=0;
    t=new Array;
    o=new Array;
    d=new Array;

    function hex(a,c)
    {
    t[a]=Math.floor(c/16)
    o[a]=c%16
    switch (t[a])
    {
    case 10:
    t[a]='A';
    break;
    case 11:
    t[a]='B';
    break;
    case 12:
    t[a]='C';
    break;
    case 13:
    t[a]='D';
    break;
    case 14:
    t[a]='E';
    break;
    case 15:
    t[a]='F';
    break;
    default:
    break;
    }
    switch (o[a])
    {
    case 10:
    o[a]='A';
    break;
    case 11:
    o[a]='B';
    break;
    case 12:
    o[a]='C';
    break;
    case 13:
    o[a]='D';
    break;
    case 14:
    o[a]='E';
    break;
    case 15:
    o[a]='F';
    break;
    default:
    break;
    }
    }

    function ran(a,c)
    {
    if ((Math.random()>2/3||c==0)&&c<255)
    {
    c++
    d[a]=2;
    }
    else
    {
    if ((Math.random()<=1/2||c==255)&&c>0)
    {
    c--
    d[a]=1;
    }
    else d[a]=0;
    }
    return c
    }
    function do_it(a,c)
    {
    if ((d[a]==2&&c<255)||c==0)
    {
    c++
    d[a]=2
    }
    else
    if ((d[a]==1&&c>0)||c==255)
    {
    c--;
    d[a]=1;
    }
    if (a==3)
    {
    if (d[1]==0&&d[2]==0&&d[3]==0)
    flag=1
    }
    return c
    }
    function disco()
    {
    if (flag==0)
    {
    r=ran(1, r);
    g=ran(2, g);
    b=ran(3, b);
    hex(1,r)
    hex(2,g)
    hex(3,b)
    document.bgColor="#"+t[1]+o[1]+t[2]+o[2]+t[3]+o[3]
    flag=50
    }
    else
    {
    r=do_it(1, r)
    g=do_it(2,g)
    b=do_it(3,b)
    hex(1,r)
    hex(2,g)
    hex(3,b)
    document.bgColor="#"+t[1]+o[1]+t[2]+o[2]+t[3]+o[3]
    flag--
    }
    if (document.all)
    setTimeout('disco()',50)
    }
    //-->
    </script>

    </head>

    <body>



    </body>
    <body onload="disco()">
    </html>

  2. #2
    Join Date
    Aug 2005
    Location
    America
    Posts
    51

    Default How to rename last extensions

    Here you can rename the last Extensions of any files, (don't try to do it with everything in your system otherwise it will damage your system) you can rename a .txt dacument to a .htm or .html website.
    Open my computer,



    Right click on tools then folder options,



    Click VIEW tag, and uncheck
    Hide extensions for known file types



    click ok and close my computer down. now you r ready to go.

  3. #3
    Join Date
    Nov 2005
    Posts
    9

    Default

    Thank you asifk7,,, I am really appreciated to your job. :D

  4. #4
    Join Date
    Oct 2005
    Location
    America
    Posts
    6

    Default

    Wow Asifk7!
    You r really great man,,,,,, i was looking this kinda scripts.

  5. #5
    Join Date
    Aug 2004
    Location
    USA
    Posts
    996

    Default

    A preview of this script would be nice.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •