Forum Gaul dan Informasi

INFO UNTUK ANDA

Y3hoo Ada di Facebook

Share Y3hoo ke Twitter

Follow Me

Image hosted by servimg.com

Y3hoo Mailing List

Enter Your Email Address:

Latest topics

» Transfer Pulsa Indosat Ooredoo
Thu Nov 17, 2016 9:04 am by alia

» Uztadz dan Kuntilanak
Mon Nov 07, 2016 12:46 pm by bocahnakal

» Jika Kamu Tua
Fri Nov 04, 2016 6:39 pm by alia

» Suku Dayak: Keindahan Tato, Ketajaman Mandau, dan Kecantikan Wanita
Fri Nov 04, 2016 11:45 am by alia

» Menyesapi Filosofi Batik Nusantara
Mon Oct 31, 2016 2:13 pm by jakarta

» Hindari 6 Kebiasaan Buruk Mengelola Keuangan di Usia Muda
Mon Oct 31, 2016 9:40 am by jakarta

» Video 100 Persen Pasti Ngakak
Sat Oct 29, 2016 5:50 pm by bocahnakal

» Tak Ada Duanya di Dunia, Merica Batak yang Pedas Beraroma Lemon
Thu Oct 27, 2016 3:27 pm by La Rose

» Di balik keUnikan Ir.Soekarno
Thu Oct 27, 2016 9:16 am by jakarta

IKLAN ANDA


    Disco Background Effect

    Share

    jakarta

    522
    23.04.10

    Disco Background Effect

    Post  jakarta on Sun Oct 03, 2010 10:17 am

    Disco Background Effect

    Get into the groove with this disco background effect script! It fades the background color continuously using a variety of colors, as if it were the dance floor!

    Step 1: Insert the following code into the section of your page:

    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>

    Step 2: Add the below event handler into the tag itself, like this:

    Code:
    <body onload="disco()">


      Waktu sekarang Sun Dec 04, 2016 1:10 pm