Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having trouble getting text to go with slideshow.

Status
Not open for further replies.

AlienE

MIS
Dec 8, 2002
3
US
I am trying to put text with each picture in the slideshow, but I would like to integrate with the script that I already have. This script works by referancing this peice of html: <img name='slide' src='picture.gif'>. The problem is, I don't know how to refernce where I want the text to go.

This is the script that I'm using:

// begin dHTML SlideShow Script

if(document.images) {
currentslide=1;
maxslides=23;
image = new Array(maxslides+1);
for(var n=1;n<=maxslides;n++) {
image[n]=new Image(400,300);
image[n].src='images/aslide-'+n+'.jpg';
}
}

function prevSlide() {
if(document.images) {
currentslide--;
if(currentslide<1) currentslide=maxslides;
document.images['slide'].src=image[currentslide].src;
}
}
function nextSlide() {
if(document.images) {
currentslide++;
if(currentslide>maxslides) currentslide=1;
document.images['slide'].src=image[currentslide].src;
}
}
// end dHTML SlideShow Script

What should I add to pull the text from an array with the same number as the image and how to I get it to display in html?

alien-e
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top