Script to change images with each visit

R

ross

I am looking for a javascript that will provide a new image each time the
viewer opens the web page. At present, I am using a date code and have
changed it to show images. But I think it only works for seven days and I
have 30 images to show. Here is what I have cobbled together. I am sure
there is a better way, but I am JS challenged to say the least. I appreciate
this newsgroup. Dick Ross

<script type="text/javascript">
var now = new Date();
var day = now.getDay();
var arday = new Array("images/crewfolder/alexcason_s.jpg",
"images/crewfolder/fran_100", "images/crewfolder/maino_s.jpg",
"images/crewfolder/rick_s.jpg", "images/crewfolder/self1_20s.jpg",
"images/crewfolder/peggy_s.jpg", "images/crewfolder/maino_s.jpg");
var artxt = new Array("Alex Cason", "Fran Maddox", "Steve Maino",
"Rick Wheaton", "Dick Ross", "Steve Yates", "Peggy Lawrey");

document.write("<img src='" + arday[day] + "'>");
document.write("<br>Today's photo artist is " + artxt[day]);
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top