PDA

View Full Version : Making a random image appear on page load


jc1cell
05-07-2009, 05:57 PM
Hello all,

I'm wondering how I can get a random image to load every time someone loads the page? I would like a different image (out of a selected set of images) to show up when the page is reloaded.

Any ideas?

jc

coloeagle
05-07-2009, 06:03 PM
http://www.dreamweaverclub.com/forum/showthread.php?t=31494&highlight=random+image

jc1cell
05-07-2009, 06:26 PM
Excellent Master Sargeant, Sir!

Knocked down two with one stone. Thank You for the quick response.

jc

coloeagle
05-07-2009, 06:36 PM
Your welcome, glad to be of assistance

jc1cell
05-11-2009, 06:49 PM
So the supplied code works excellent...but now I need it to run separately on three different image boxes I have set up. I tried different things to the .js but I really know nothing of javascript.

Visit the site (http://users.onelinkpr.net/jcsaladin/sosasigns/inicio.htm) so you can see what I'm looking for. Each of the bottom three boxes should have different random images selected. I created three different .js files with paths to 3 different image folders. I placed three different js calls for the different .js files and also in each box I placed the <script> <noscript> code. Like I said it works great but no matter what I change in the .js as far as variable names I can't get them to look at their respective image folders.

Any help would be awesome.

jc

jc1cell
05-11-2009, 07:44 PM
Ok...so I worked the variable name changes a bit deeper and methodical and was able to pinpoint which one needed changing and finally got it to work.

Thanks for those who looked and started attempting to find a solution.

jc