anyone know javascript?

Discussion in 'Software' started by mr_flea, Oct 31, 2003.

  1. mr_flea

    mr_flea First Sergeant

    I need some javascript program that will fade the background from a color to a picture. I already have a fade program, but it fades from color to color, and then stops. I want it to fade from color to tiled picture background and then stop. If it fades from color to transparent, that would work too if I could get something to set the picture as a tiled background before the code ran or something like that. I don't care how it does it, as long as it works with IE.

    Thanks in advance!
     
  2. iamien

    iamien Cptn "Eh!"

    post the code you have for current one. i'll mod it a bit. too tierd to go from scatch.

    remmeber to use code tags [ code] [/c ode < obivously wihtout spaces>
     
  3. mr_flea

    mr_flea First Sergeant

    The board doesn't need code tags.


    <script language="javascript">
    <!--
    function makearray(n)
    {
    this.length = n;
    for(var i = 1; i <= n; i++) this = 0;
    return this;
    }

    hexArray = new makearray(16);


    for(var i = 0; i < 10; i++) hexArray = i;
    hexArray[10]="A"; hexArray[11]="B"; hexArray[12]="C";
    hexArray[13]="D"; hexArray[14]="E"; hexArray[15]="F";

    function makeHex(i)
    {
    if (i < 0) return "00";

    else if (i > 255) return "FF";

    else
    return "" + hexArray[Math.floor(i/16)] + hexArray[i%16];
    }


    function setbgColor(r, g, b)
    {
    var red = makeHex(r); var green = makeHex(g); var blue = makeHex(b);
    document.bgColor = "#"+red+green+blue;
    }


    function fade(sr, sg, sb, er, eg, eb, inc)
    {
    // keep updating the background color
    for(var i = 0; i <= inc; i++)
    {
    setbgColor(
    Math.floor(sr * ((inc-i)/inc) + er * (i/inc)),
    Math.floor(sg * ((inc-i)/inc) + eg * (i/inc)),
    Math.floor(sb * ((inc-i)/inc) + eb * (i/inc)));
    }
    }



    // (RGB Color Values)
    fade(255,102,0, 0,0,51, 1000);


    // -->
    </script>
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds