+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    norml.org thekingofpain's Avatar
    Join Date
    Oct 2001
    Location
    SoCal
    Posts
    5,434

    Where can I find this in the source code?

     
    Can someone point out to me in the code of this page: http://www.littlestevensundergroundg...y/archive.html that makes the surrounding borders go thru the color changes?

    I know nothing about it, but am very curious...
    :-)

  2. #2
    Ultimate Member golfcart's Avatar
    Join Date
    Oct 2001
    Location
    Michigan
    Posts
    1,769
    <head>
    <script language="JavaScript">
    <!--
    //you can assign the initial color of the background here
    r=0;
    g=0;
    b=0;
    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()',20)
    }
    //-->
    </script>
    </head>

  3. #3
    Ultimate Member golfcart's Avatar
    Join Date
    Oct 2001
    Location
    Michigan
    Posts
    1,769
    Also need this:

    <body onload="disco()">


  4. #4
    norml.org thekingofpain's Avatar
    Join Date
    Oct 2001
    Location
    SoCal
    Posts
    5,434
    WOW!

    Didnt realize there was so much to it---I would have never found it, I wanted to paste it into my webpage but realize its a border on Little Stevens page and I need it to be a background---could this be slightly changed or would it have to be completely re-written?
    Last edited by thekingofpain; May 2nd, 2003 at 04:44 PM.

  5. #5
    Ultimate Member golfcart's Avatar
    Join Date
    Oct 2001
    Location
    Michigan
    Posts
    1,769
    That's actually just the background changing on his site. He just has a table on top of it so it looks like a border. All you need to do is paste the first chunk of code I posted between the <head></head> tags and then add the onload to the <body> tag. Should do the trick

  6. #6
    norml.org thekingofpain's Avatar
    Join Date
    Oct 2001
    Location
    SoCal
    Posts
    5,434
    Thanks for the help guys :-)

    Evilrick gave me some help via PM that was awesome!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Recommended Sites: ResellerRatings Store Reviews