Results 1 to 3 of 3

Thread: How to add an image on back of the result numbers on lottery number picker script

  1. #1
    Join Date
    Dec 2014
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to add an image on back of the result numbers on lottery number picker script

    1) Script Title: lottery number picker

    2) Script URL (on DD): Just testing it!

    3) Describe problem: No problem, just want to know if is possible to add an image to the numbers!

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.


    just want to know if is possible to add an image to the numbers!
    What do you mean exactly? After you've filled the gaps from above, it's likely you'll need to copy portions of code from the demo page to demonstrate your edit attempts or provide an image mock-up to illustrate what you're trying to achieve.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
      <base href="http://www.vicsjavascripts.org/StdImages/"  />
    <style type="text/css">
    .a1{
    position:relative;
    font-family:Verdana;
    font-size:20px;
    color:#888888;
    }
    
    .layer1 IMG {
     width:50px;
    }
    
    </style>
    
    <script language="JavaScript">
    
    /*****************************************
    * Lottery Picker (By Kurt at kurt.grigg@virgin.net)
    * Featured on/available at http://www.dynamicdrive.com/
    * Modified by DynamicDrive.com for below config options
    * This notice must stay intact for use.
    *****************************************/
    
    var totalnumbers=6 //input total numbers to generate
    var lowerbound=1   //input lower bound for each random number
    var upperbound=49  //input upper bound for each random number
    var images=['0.gif','1.gif','2.gif','3.gif','4.gif','5.gif','6.gif','7.gif','8.gif','9.gif']
    
    
    function lotto(){
     var B='&nbsp;&nbsp;&nbsp;&nbsp; ',LottoNumbers=[],RandomNumber;
     for (var i = 1; i <= totalnumbers; i++) {
      RandomNumber = Math.round(lowerbound+Math.random()*(upperbound-lowerbound));
      for (var j = 1; j <= totalnumbers; j){
       if (RandomNumber == LottoNumbers[j]){
         RandomNumber=Math.round(lowerbound+Math.random()*(upperbound-lowerbound));
         j=0;
        }
        j++;
       }
      LottoNumbers[i]=RandomNumber;
     }
     LottoNumbers=LottoNumbers.toString();
     var X=LottoNumbers.split(','),OutPut='';
     for (i=0; i < X.length; i++){
      X[i]=X[i]+' ';
      if (X[i].length==2)
       X[i]='0'+X[i];
      }
      X=X.sort();
      for (var i=1; i < X.length; i++){
       OutPut+='<img src='+images[X[i].charAt(0)]+' /><img src='+images[X[i].charAt(1)]+' />'+B;
      }
     document.getElementById("layer1").innerHTML=OutPut;
     T=setTimeout('lotto()',20);
    //window.status=OutPut;
    }
    
    function StOp(){
     setTimeout('clearTimeout(T)',1000);
    }
    //-->
    </script></head>
    
    <body>
    <table border='0' width=750 height=50>
    <tr valign='middle'>
    <td align='center'>
    <form name=form>
    <input type=button value='Lottery Number Picker' onClick="lotto();StOp()">
    </form>
    <span id=layer1 class="layer1" class=a1>Result</span>
    </td>
    </tr>
    </table>
    </body>
    
    </html>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Similar Threads

  1. Lottery Picker
    By Sombra6 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 02-03-2013, 05:40 PM
  2. Lottery Numbers Generator Issues in IE
    By shellshock30 in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 11-19-2010, 01:29 PM
  3. About Lottery Picker
    By pangetkah002 in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 12-03-2008, 02:34 PM
  4. Lottery Picker Script-Justification
    By kgilbert in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 12-28-2006, 11:44 PM
  5. California Super Lottery Plus Number Picker
    By cucunusa in forum Submit a DHTML or CSS code
    Replies: 0
    Last Post: 09-10-2006, 07:58 PM

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
  •