How do I add random number generation

Discussion in 'Java' started by Fan924, Sep 10, 2008.

  1. Fan924

    Fan924 Guest

    How do I add random number generation to this background image slide
    show? Everything I try kills if. TIA
    _____________________________________

    _

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 2</title>
    </head>
    <body>
    <SCRIPT LANGUAGE="JavaScript1.2">
    var pic=new Array()
    pic[0]="pic/./000.bmp"
    pic[1]="pic/./001.jpg"
    pic[2]="pic/./002.jpg"
    pic[3]="pic/./003.jpg"
    pic[4]="pic/./004.jpg"
    pic[5]="pic/./005.jpg"
    pic[6]="pic/./006.jpg"
    pic[7]="pic/./007.jpg"
    pic[8]="pic/./008.jpg"
    pic[9]="pic/./009.jpg"
    var img=new Array()
    for (i=0;i<pic.length;i++){
    img=new Image()
    img.src=pic
    }
    var enf=-1
    function Slide(){
    if (enf<pic.length-1)
    enf++
    else
    enf=0
    document.body.background=img[enf].src
    }
    if (document.all||document.getElementById)
    window.onload=new Function('setInterval("Slide()",1000)')
    </SCRIPT></BODY></HTML>
    Fan924, Sep 10, 2008
    #1
    1. Advertising

  2. Fan924

    Roedy Green Guest

    On Wed, 10 Sep 2008 03:52:59 -0700 (PDT), Fan924 <>
    wrote, quoted or indirectly quoted someone who said :

    >How do I add random number generation to this background image slide
    >show? Everything I try kills if. TIA
    >____________________________________


    This group is about Java, not JavaScript. To handle the problem in
    Java , see http://mindprod.com/jgloss/pseudorandom.html

    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Sep 12, 2008
    #2
    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. dpi

    Random Number Generation

    dpi, Mar 13, 2006, in forum: VHDL
    Replies:
    4
    Views:
    10,049
    vipinlal
    Mar 26, 2010
  2. ANM
    Replies:
    2
    Views:
    1,347
    Thomas Schodt
    Mar 7, 2004
  3. mescaline
    Replies:
    4
    Views:
    1,317
    Cy Edmunds
    Sep 10, 2003
  4. globalrev
    Replies:
    4
    Views:
    745
    Gabriel Genellina
    Apr 20, 2008
  5. VK
    Replies:
    15
    Views:
    1,126
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page