DONJUAN FORUM COMMUNITY ALL IN ONE BASIC

**SELAMAT DATANG DI DONJUAN COMMUNITY FORUM ALL IN ONE**

Silahkan Registrasi & Login untuk Akses penuh ,
Terima kasih atas Kunjungan-nya
DONJUAN FORUM COMMUNITY ALL IN ONE BASIC


    SCRIPT BACKGROUND PELANGI

    Share

    TriLLianT

    Jumlah posting : 33
    Points : 87
    Reputation : 1
    Join date : 13.12.10
    Age : 30
    Lokasi : semarang

    SCRIPT BACKGROUND PELANGI

    Post  TriLLianT on Tue 08 Mar 2011, 05:39

    Code:

    <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.body.style.background="#"+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.body.style.background="#"+t[1]+o[1]+t[2]+o[2]+t[3]+o[3]
    flag--
    }

    setTimeout('disco()',50)
    }
    //-->
    </script>
    <body onload="disco()">


    CONTOH : [You must be registered and logged in to see this link.]

    ihirrrrrrrrrrrrrrrrrrr


    Terakhir diubah oleh TriLLianT tanggal Mon 02 May 2011, 05:46, total 1 kali diubah

    punkers

    Jumlah posting : 21
    Points : 45
    Reputation : 0
    Join date : 09.12.10
    Age : 28
    Lokasi : bogor

    Re: SCRIPT BACKGROUND PELANGI

    Post  punkers on Wed 09 Mar 2011, 18:12



    Mantap....mantappp.... thank buat Tutornya ....

    ijin pake buat di blog ane ya.....






    TriLLianT

    Jumlah posting : 33
    Points : 87
    Reputation : 1
    Join date : 13.12.10
    Age : 30
    Lokasi : semarang

    Re: SCRIPT BACKGROUND PELANGI

    Post  TriLLianT on Fri 18 Mar 2011, 04:02

    silahkan om.............. ayee ayeee

    Sponsored content

    Re: SCRIPT BACKGROUND PELANGI

    Post  Sponsored content Today at 03:03


      Waktu sekarang Sat 03 Dec 2016, 03:03