PDA

View Full Version : Can text be added to the DHTML slideshow script?



Kalina
03-11-2005, 06:49 PM
I need to have the text to the right of the image change with each image. So when you click "Next" the text on the right will change to describe the image on the left.

You can see what I am trying to do here:
http://www.kalinawebdesigns.com/drafts/RSPI/GraphicOverlayGallery.htm

Any and all help is greatly appreciated.

Thank you,
Kalina

jscheuer1
03-11-2005, 08:06 PM
That's a job for innerHTML and getElementById.

where you have:


<div name="photoslider">
use:


<div id="photodesc">
then, each place this appears:


document.images.photoslider.src=photos[which]
follow it on the next line with:


document.getElementById('photodesc').innerHTML=desc[which]
This should all work because you have already created the array, desc[] which has the descriptions in it. If I've followed your code correctly, all you should have to mess with after doing the above is changing the actual descriptions' text.

Note: this solution has been corrected as per Kalina's astute observation.

Kalina
03-11-2005, 08:23 PM
Thanks for the help jscheuer1.

I've added your code in and it doesn't change the text yet, but doesn't cause error's either. I will work with this and see if I can get it going.

Thanks,
Kalina

Kalina
03-11-2005, 09:46 PM
Thanks again, I got it working, I just need to make Html all uppercase IE; HTML.

Kalina

jscheuer1
03-11-2005, 10:24 PM
You're welcome, sorry about the capitalization error on my part, I've corrected it in my original post.