[thelist] JS image randomizer

Mehmet Efe Mehmet.Efe at frogdesign.com
Mon Apr 2 14:41:23 CDT 2001

Here is a quickie for you too aardvark:

<script language="Javascript">

var currentdate = 0
var core = 0

function StringArray (n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '


image = new StringArray(4)
image[0] = '/images/something.jpg'
image[1] = '/images/another.jpg'
image[2] = '/images/thethird.jpg'
image[3] = '/images/onemore.gif'

var ran = 60/image.length

function ranimage() {
  currentdate = new Date()
  core = currentdate.getSeconds()
  core = Math.floor(core/ran)

document.write("<img src='" +ranimage()+ "' border=0>")


Place the code to whereever you want your image(s) appear. List all your
images after image = new StringArray(4) and put the total number in that
paranthesis. (In this sample we have only four images)

The randomizer is tied to current time divided by The division factor you
define at ' var ran ='. You'll get around very easy.


<TechieTurk />

f  r  o  g
Mehmet Efe
Production Specialist / Design Technologist
D  i  g  i  t  a  l    M  e  d  i  a
mehmet.efe at frogdesign.com
Tel: (415) 442-4804
Fax: (415) 442-4803

-----Original Message-----
From: aardvark [mailto:roselli at earthlink.net]
Sent: Monday, April 02, 2001 12:20 PM
To: thelist at lists.evolt.org
Subject: [thelist] JS image randomizer

need a JavaScript image randomizer... the ones i've found tend to 
be kinda crappy... obviously working across all browsers/platforms 
is key...  SSI not an option here... needs to allow for images of 
different sizes, if possible...

suggestions?  samples?

For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 

More information about the thelist mailing list