SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast montroze's Avatar
    Join Date
    Mar 2002
    Location
    Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Delay Text Print

    In this lotto code I would like the 'These could be winners' to print out below the random numbers after they are generated, what command would I use...or can it even be done?

    <BODY>
    <table border='0' width=250 height=50>
    <tr valign='middle'>
    <td align='center'>
    <form name=form>
    <input type=button value='Lottery Number Picker' onClick="lotto(),setTimeout('clearTimeout(T)',2000)">
    </form>
    <span id=layer1 class=a1><font color="black">Your Quick Pick</span><br>
    These could be winners!
    </td>
    </tr>
    </table>


    </BODY>
    </HTML

  2. #2
    Rehab is for quiters! spartan's Avatar
    Join Date
    Apr 2002
    Location
    Cape Town, South Africa
    Posts
    343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, very possible...
    what are you using here? vbscript??

    if you are, you have a couple of options.

    first...
    insert a div tag around the text like so, <div id="mydiv" name="mydiv">these could be winners</div>.

    then the important part is just making the div invisible and then turning it 'on' again when you want the text to apear.

    so...
    <div id="myDiv" name="myDiv" style="display:none">these could be winners</div>

    and to turn it back on again, in your script, whenever you want it displayed...
    myDiv.style.display = ""

    or to turn it off again...
    myDiv.style.display = "none"

    thats one way, the other way would be to give your <td>
    a id, <td id=mytd name=mytd> and then in your script set the actual contents of the td like so...

    mytd.innerHTML = "<font color=black>these could be winners</font>"

    hope that helps.
    Last edited by spartan; Apr 25, 2002 at 06:02.
    Spartan
    ---------------------
    It's like our sergeant told us before one trip into the jungle. Men! Fifty of you are leaving on a mission. Twenty-five of you ain't coming back.
    -Mr.Payne

  3. #3
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is the full code you would use hope its what you need

    PHP Code:

    <SCRIPT>

    rnd.today=new Date();
    rnd.seed=rnd.today.getTime();

    function 
    rnd()
    {
            
    rnd.seed = (rnd.seed*9301+49297) % 233280;
            return 
    rnd.seed/(233280.0);
    };

    function 
    rand(number) {
            return 
    Math.ceil(rnd()*number);
    };


    function 
    win(random_max)
    {
        
    myDiv.style.display "block";
        
    num.style.display   "block";
        
    num.innerHTML rand(random_max)+','+rand(random_max)+','+rand(random_max)+','+rand(random_max)+','+rand(random_max)+' and bonus ball '+rand(random_max);
    }
    </SCRIPT>

    <div id="myDiv" name="myDiv" style="display:none">these could be winners</div>
    <div id="num"   name="num"   style="display:none">winning numbers</div> 
    <a href="javascript:win(50)">click to pick</a> 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •