Houston3000
n00b
- Joined
- Dec 14, 2006
- Messages
- 59
Right now I have a very simple Javascript image array
along with an image on the page and buttons that control the script
This is for a web gallery of photographs, basically a picture in the center with a Back and Forward button to cycle through them. I also have an actual thumbnail gallery though, as I want people to be able to load the images they want without having to manually cycle through all of them. How then would I link to a specific image in this javascript array from a separate Web Gallery page?
I hope this is the right place to ask this, any help would be appreciated
<script language="JavaScript"<!--
ImageNames = new Object();
ImageNames.length = 56;
for (counter = 0; counter < 57; counter++) {
file_number = counter + 1;
file_name = ("image" + file_number + ".jpg");
ImageNames[counter] = file_name;
}
//--></script>
<script language="JavaScript">
<!--
which_image_loaded = 0;
function changeImage(direction) {
which_image_loaded += direction;
if (which_image_loaded < 0)
which_image_loaded = 56;
if (which_image_loaded > 56)
which_image_loaded = 0;
if (document.images)
document.myimage.src = ImageNames[which_image_loaded];
}
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
along with an image on the page and buttons that control the script
<a href="javascript:changeImage(-1)">
along with
<img src="image1.jpg">
This is for a web gallery of photographs, basically a picture in the center with a Back and Forward button to cycle through them. I also have an actual thumbnail gallery though, as I want people to be able to load the images they want without having to manually cycle through all of them. How then would I link to a specific image in this javascript array from a separate Web Gallery page?
I hope this is the right place to ask this, any help would be appreciated