Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Script to change images with each visit

Reply
Thread Tools

Script to change images with each visit

 
 
ross
Guest
Posts: n/a
 
      01-25-2006
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>


 
Reply With Quote
 
 
 
 
ross
Guest
Posts: n/a
 
      01-25-2006
Figured it out, Thanks, though, Dick Ross


"ross" <(E-Mail Removed)> wrote in message
news:58c3$43d7d0fb$40971e23$(E-Mail Removed)...
>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>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transform a 2D color image into 2 images of (R1,G1,B) at each pixelof image 1 and (R2,G2,B) at each pixel of image2 for STEREO visualization 88888 Dihedral C++ 10 12-23-2011 02:28 PM
how to change images based on action.Even clicking changed images should do respective actions? vj Javascript 3 01-12-2007 12:26 PM
script to visit a page akanksha.baid@gmail.com Ruby 2 07-07-2006 07:38 PM
how do i? Full scan of each control in each grid row cell John Blair ASP .Net 1 08-03-2005 11:02 AM
visit my site - Olympus c700/750 images Rich Digital Photography 0 05-04-2004 11:19 AM



Advertisments