help with random photo script

N

nyguy8103

Hi guys. I use a random photo script which works out great for me.. the
script is as follows.....

function image() {
};

image = new image();
number = 0;

// imageArray
image[number++] = "<img src='images/1.jpg' border='1'>"
image[number++] = "<img src='images/2.jpg' border='1'>"
image[number++] = "<img src='images/3.jpg' border='1'>"
image[number++] = "<img src='images/4.jpg' border='1'>"

increment = Math.floor(Math.random() * number);

document.write(image[increment]);

//--></SCRIPT>


... recently, I've had requests for the random pictures that display to be
linked to a fullsize photo when clicked. Is there something I can add to the
above script to have every random photo be hyperlinked to a larger one?
 
N

Nicholas Savalas

Dear New York,
The default installation of IIS comes with a Microsoft banner ad component
called AdRotator. It is NOT just for banners; and does NOT have to be
468x60. It can randomize almost anything, and redirect almost anywhere. You
can custom set the "ALT" text for every image. Specify a border size to
indicate to visitors it is a link. Further, you can "weight" the rotator to
show some things more than others, on the average. Let your imagination run
wild, New York. It is the most under-used component I know of, and one of
the most useful. Try it; simple instructions are everywhere, including here:
http://www.codetoad.com/asp_banner_ad_rotator.asp - good luck.
 
J

Jon Spivey

Hi,
Just stick the links around the image tags, eg
image[number++] = "<a href=\"1big.jpg\"><img src='images/1.jpg'
border='1'></a>"
etc
you'd probably want to make this nicer by making an html page for each image
and/or using javascript to open in a sized pop up window.
 

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

Top