Results 1 to 2 of 2
  1. #1

    Member Since
    Apr 08, 2004
    Question Dual JS image randomizer?
    I use the following JS for a simple but effective image randomizer:

    <SCRIPT LANGUAGE="JavaScript">
    	  <!-- Hide from old browsers
    	  iArray=new Array(
    	  ri='<IMG SRC="'+ iArray[ri]+ '" BORDER=0>';
    	// end hiding --></SCRIPT>
    <SCRIPT language="JavaScript">
    	// -->
    That works great to randomly pull one of the images listed. I'm curious, though... Would anyone like to take a crack at expanding that code so that a matching background image is pulled into that image's cell?

    Basically what I'm getting at is that I have a cell with the random image code applied to it, but the cell expands horizontally the fill the browser window. Because each of the main images is a finite width, I'm left with a rather large and ugly gaping hole to the right of the image when a user expands their browser. To work around that, I'd like to create a repeating background image for that cell that would give the appearance of the image continuing to the right. Problem is, I have no idea what the code would be to match up each random "main" image with its background image, so that when the main one is randomly displayed the background image would match.

    I'd be ridiculously grateful if anyone could help me out here.


  2. #2

    Member Since
    Apr 08, 2004


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can I use a system image of a macbook pro to image an iMac?
    By lloydy21 in forum macOS - Operating System
    Replies: 5
    Last Post: 04-15-2015, 09:47 AM
  2. Select part of image and diplay in image view
    By xcodelearner in forum iOS and Apps
    Replies: 0
    Last Post: 10-10-2010, 05:37 PM
  3. inDesign scripting - multiple image files from single image
    By megadice in forum Images, Graphic Design, and Digital Photography
    Replies: 0
    Last Post: 03-15-2010, 06:38 PM
  4. Transparent Image to Image and Mask? Photoshop? Another Converter-Application?
    By roggnroll in forum Images, Graphic Design, and Digital Photography
    Replies: 1
    Last Post: 08-08-2007, 04:55 PM
  5. sliced grid image forming large image in folder
    By devon in forum macOS - Operating System
    Replies: 1
    Last Post: 10-24-2004, 06:23 PM

Posting Permissions

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