Help with more Random Code!!!

Discussion in 'Javascript' started by Virus, Feb 18, 2004.

  1. Virus

    Virus Guest

    Here is my html file~

    I am trying to get this fadeing text to appear randomly- not in order.
    As it is it goes (im tired/im helpless/i cant figure it out/ argg help me/
    thanks) I want this to be completly random and looped.
    Can anyone plz show me the light!

    SNIP{{{{var qiksearch_js_text = new Array ("im tired", "im helpless", "i
    cant figure it out", "ARGGG HElp ME", "Thanks");))) SNIP





    <html>

    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>dfdf</title>
    </head>


    <body onLoad="random()">
    <p><!--webbot bot="HTMLMarkup" startspan --><SCRIPT LANGUAGE="JavaScript">
    <!--
    function random(){
    var max = 6;
    wall = Math.floor(Math.random() * max) + 1;

    if (wall == 1)
    { document.bgColor = "FFCFCF" }

    else
    if (wall == 2)
    { document.bgColor = "FFFFCF" }

    else
    if (wall == 3)
    { document.bgColor = "CFFFCF" }

    else
    if (wall == 4)
    { document.bgColor = "CFFFFF" }

    else
    if (wall == 5)
    { document.bgColor = "FFCFFF" }

    else
    if (wall == 6)
    { document.bgColor = "FFFFFF" }
    }
    //-->
    </SCRIPT><!--webbot bot="HTMLMarkup" endspan --></p>

    </body>

    <p align="center"><!--webbot bot="HTMLMarkup" startspan --><SCRIPT
    LANGUAGE="JavaScript">
    <!-- Begin
    var qiksearch_js_text = new Array ("im tired", "im helpless", "i cant figure
    it out", "ARGGG HElp ME", "Thanks");
    var qiksearch_space_width = 400; // The width of the content space
    var qiksearch_space_height = 100; // The height of the content space
    var qiksearch_space_borderw=0; // Border width
    var qiksearch_space_borderc=""; // Border Color
    var timeOutVal=500; // Delay in milliseconds

    document.write('<table width="' + qiksearch_space_width + '" height="' +
    qiksearch_space_height + '" style="background:; border:' +
    qiksearch_space_borderw + ' solid ' + qiksearch_space_borderc + '"><tr><td
    align="middle">');
    document.write('<div id="qiksearch_js_space">');
    document.write('</div>');
    document.write('</td></tr></table>');

    var def_10='A',def_11='B',def_12='C',def_13='D',def_14='E',def_15='F';
    var colorVal=15;
    var div_count=0;

    function qiksearch_fade_desat(getColorIntVal)
    {
    var returnVal;
    if(getColorIntVal>=10)
    {
    for(var i=0; i<=15; i++)
    {
    if((getColorIntVal==i))
    {
    returnVal = eval('def_' + i);
    }
    }
    }
    else
    {
    returnVal=getColorIntVal;
    }
    return(returnVal);
    }

    function writeDiv()
    {
    document.all.qiksearch_js_space.innerHTML= '<font face="Bradley Hand ITC"
    size="4" color="' + joinColor(qiksearch_fade_desat(colorVal)) + '"><b>' +
    qiksearch_js_text[div_count] + '</span></b></font>' ;

    if((colorVal>0) && (colorVal!=0))
    {
    colorVal--;
    }
    else
    {
    colorVal=15;
    if(div_count<qiksearch_js_text.length)
    {
    div_count++;
    }
    if(div_count==qiksearch_js_text.length)
    {
    document.all.qiksearch_js_space.innerHTML = '<a
    href="javascript:resetAll();writeDiv();" style="text-decoration:none"
    accesskey="l"><font color="#fffff" face="Bradley Hand ITC" size="-1"><font
    color="#fffff">ยป</font></b></font></a>';
    }
    }

    if(div_count<qiksearch_js_text.length)
    {
    setTimeout("writeDiv()",timeOutVal);
    }
    }

    function joinColor(getColor)
    {
    return (getColor + '0' + getColor + '0' + getColor + '0');
    }

    function resetAll()
    {
    div_count=0;
    colorVal=15;
    }

    writeDiv();
    // End -->
    </script><!--webbot bot="HTMLMarkup" endspan --></p><!--webbot
    bot="HTMLMarkup" endspan --></p>

    </body>

    </html>
    Virus, Feb 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lars-Erik Aabech
    Replies:
    8
    Views:
    820
    Lars-Erik Aabech
    Apr 28, 2005
  2. Elmar Baumann
    Replies:
    0
    Views:
    595
    Elmar Baumann
    Feb 2, 2004
  3. Michael
    Replies:
    4
    Views:
    395
    Matt Hammond
    Jun 26, 2006
  4. globalrev
    Replies:
    4
    Views:
    740
    Gabriel Genellina
    Apr 20, 2008
  5. VK
    Replies:
    15
    Views:
    1,113
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page