Kobus Mans
05-05-2009, 02:33 AM
Hello All
OK, I am very new at this so please forgive me if I say something stupid :P
I am trying to create a dynamic text field that need to match a image that I am loading using an image array. But have no idea how to have the two arrays sync up.
In short I am creating a gallery, each image has a short description associated with it. Right now the gallery works great but I need to add the text. does anyone know how to do this? I am completely lost and have been banging my head against the table all day.
This is s sample of the script I have for the image array... not sure it this will help...
[CODE] var pickArray = new Array();
pickArray[1] = new Image();
pickArray[1].src = "images/port_0000_LayerComp1.jpg";
pickArray[2] = new Image();
pickArray[2].src = "images/port_0001_LayerComp2.jpg";
pickArray[3] = new Image();
pickArray[3].src = "images/port_0002_LayerComp3.jpg";
imageNumber = 1
totalImages = 3
function changeSlide(direction) {
imageNumber = imageNumber + direction
if (imageNumber < 1) {
imageNumber = totalImages;
}
if (imageNumber > totalImages) {
imageNumber = 1;
}
document.Photo.src = pickArray[imageNumber].src;
}
[CODE]
Does anyone know how I should proceed from here on out? or even where to begin?
OK, I am very new at this so please forgive me if I say something stupid :P
I am trying to create a dynamic text field that need to match a image that I am loading using an image array. But have no idea how to have the two arrays sync up.
In short I am creating a gallery, each image has a short description associated with it. Right now the gallery works great but I need to add the text. does anyone know how to do this? I am completely lost and have been banging my head against the table all day.
This is s sample of the script I have for the image array... not sure it this will help...
[CODE] var pickArray = new Array();
pickArray[1] = new Image();
pickArray[1].src = "images/port_0000_LayerComp1.jpg";
pickArray[2] = new Image();
pickArray[2].src = "images/port_0001_LayerComp2.jpg";
pickArray[3] = new Image();
pickArray[3].src = "images/port_0002_LayerComp3.jpg";
imageNumber = 1
totalImages = 3
function changeSlide(direction) {
imageNumber = imageNumber + direction
if (imageNumber < 1) {
imageNumber = totalImages;
}
if (imageNumber > totalImages) {
imageNumber = 1;
}
document.Photo.src = pickArray[imageNumber].src;
}
[CODE]
Does anyone know how I should proceed from here on out? or even where to begin?