39 users online (0 members and 39 guests)  


Page 2 of 2 First 1 2
  Results 16 to 17 of 17

Related

  1. Random pictures in each table data cell    Forum: HTML Forum
    Replies: 0
  2. Random Pictures script doesn't always work.    Forum: Javascript Forum
    Replies: 1
  3. Random pictures HTML    Forum: HTML Forum
    Replies: 1
  4. Replies: 4
  5. Pictures    Forum: Graphics Forum
    Replies: 23
  1. #16
    GMartin's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2007
    Location
    Las Vegas
    Posts
    2

    Re: Random pictures HTML

    Hi I am trying to use this code for a Basic Entry Page to a website... I thought I was using it right but its not working... can you help me out with this..
    HTML 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" lang="en" xml:lang="en">
    <head>
    <title>Beat Works Audio</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    
    <style type="text/css">
    <!--
    .style1 {
        color: #FFFFFF;
        font-size: large;
        font-weight: bold;
    }
    .style2 {color: #FFFFFF}
    .style3 {font-size: x-large}
    -->
    </style>
    </head>
    
    <body bgcolor="#000000">
    <table width="100%" height="666"  border="0" cellspacing="10" bgcolor="#000000">
      <tr align="center" valign="middle">
        <th height="15" colspan="3" scope="col">&nbsp;</th>
      </tr>
      <tr>
        <th width="15%" height="556" align="left" valign="top" scope="row">&nbsp;</th>
        <td width="70%" align="center" valign="top">
        <p><img name="someimage" src=""></p>
        <p><a href="/catalog" class="style1 style3">Click Here to Enter</a> </p></td>
        <td width="15%" align="right" valign="top">&nbsp;</td>
      </tr>
      <tr align="center" valign="middle">
        <th height="49" colspan="3" scope="row"><span class="style2">Beat Works Audio. All Rights Reserved. </span></th>
      </tr>
    </table>
    </body>
    <script type="text/javascript">
    var aryimages = new Array('images/logo1.jpg', 'images/logo2.jpg',);
    someimage.src = aryimages[Math.floor(Math.random() * aryimages.length)];
    </script></p>
    </html>

  2. #17
    GMartin's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2007
    Location
    Las Vegas
    Posts
    2

    Re: Random pictures HTML

    I got this one to work thanks though...

    HTML Code:
    <head>
    <SCRIPT LANGUAGE="JavaScript">
    
    var theImages = new Array() 
    
    theImages[0] = 'images/art/logo1.jpg'
    theImages[1] = 'images/art/logo2.jpg'
    
    
    
    var j = 0
    var p = theImages.length;
    var preBuffer = new Array()
    for (i = 0; i < p; i++){
       preBuffer[i] = new Image()
       preBuffer[i].src = theImages[i]
    }
    var whichImage = Math.round(Math.random()*(p-1));
    function showImage(){
    document.write('<img src="'+theImages[whichImage]+'">');
    }
    
    //  End -->
    </script>
    
    </head>
    <body>
    
    <SCRIPT LANGUAGE="JavaScript">
    
    showImage();
    
    </script>
        
    </body>
    </html>



Page 2 of 2 First 1 2

Tags for this Thread