Link to home
Start Free TrialLog in
Avatar of devinm
devinm

asked on

Random

I need a random thing for my page. I need to have like 4 random events that can happen.
For each random event, I need a random picture displayed out of a list of 4 pictures. Can someone explain to me how to do this???
Avatar of clambake
clambake

Since you are not asking this on the CGI question area I assume you would rather do this on the client side than on the server side (like javascript instead of perl).

Here is how I would do this:

Every n seconds we generate a random number.  If the random number equals 1, 2, 3, or 4 then we will display the appropriate image.  If the random number generated is 5 or higher, then do nothing.  

Since it is a little lengthy, I have posted an example on line instead of pasting it all here.  It is at:

http://www3.onanalysis.com/dev/rand/

View the source... hopefully this is what you are looking for.
Avatar of devinm

ASKER

Sorry, need more of an explaination. This is 600 points ya know...
ASKER CERTIFIED SOLUTION
Avatar of gabsi
gabsi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial