T
Timmy
I'd like to display a simple image gallery based on location search
substrings. Not typical image replacement method, but the same page simply
reloaded but with different search substring parameters, e.g.
page.html?00002.jpg
The images would be defined in a typed out array something like this:
var images = new Array
("00001.jpg",
"00002.jpg",
"00003.jpg")
d = document;
if (location.search){
var image = location.search.substring(1);
}
if(image){
d.write('<img src="images/'+image+'">');
}
To determine back (<<) and forward (>>) arrow lin values for next and
previous images, after the scripts retrieves the given image name, how can
I cycle through the images array to determine which index position is
matching the one in the search substring and place that value in a variable?
If my URL string is page.html?00002.jpg, the image name should of course
match the one in array position 1 so the script can thereafter know to link
the next arrow to index position 2 and previous arrow to position 0.
I guess its a simple question, but which I can't remember the answer to...
Many thanks!
substrings. Not typical image replacement method, but the same page simply
reloaded but with different search substring parameters, e.g.
page.html?00002.jpg
The images would be defined in a typed out array something like this:
var images = new Array
("00001.jpg",
"00002.jpg",
"00003.jpg")
d = document;
if (location.search){
var image = location.search.substring(1);
}
if(image){
d.write('<img src="images/'+image+'">');
}
To determine back (<<) and forward (>>) arrow lin values for next and
previous images, after the scripts retrieves the given image name, how can
I cycle through the images array to determine which index position is
matching the one in the search substring and place that value in a variable?
If my URL string is page.html?00002.jpg, the image name should of course
match the one in array position 1 so the script can thereafter know to link
the next arrow to index position 2 and previous arrow to position 0.
I guess its a simple question, but which I can't remember the answer to...
Many thanks!