PDA

View Full Version : How to add text description in Preloaded Slide Show



yujinoen
12-05-2006, 06:10 AM
1) Script Title: Preloaded Slide Show Script by Jason Moon

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/preloadslide.htm

3) Describe problem: I'd like to add a text description which will go under the image. (each image with its own description)

another script has text description in it...
Interactive image slideshow with text description
http://www.dynamicdrive.com/dynamicindex14/interslide.htm

but since I prefer preloaded one, I wonder if I can add text description into the preloaded slide show...

please help~ ^_^

jscheuer1
12-05-2006, 07:35 AM
Have a look here:

http://www.dynamicdrive.com/forums/showthread.php?t=13814

That request was slightly different so, if you need more help, let me know.

yujinoen
12-05-2006, 11:49 PM
Hi~
thank you for the reply~
uh...I already got that script (showing text "Picture 1 of 10") - and thank you for that one~ ^_^

but besides that showing "# of pics" script, I wanted to add extra sentence along with each image...

Like if I load a image, "pic01.jpg"
I want to show text description that says like "This is a picture of me~"
then, next loaded image "pic02.jpg" with different sentence, "This is a second image"...

I wonder if it's possible...

jscheuer1
12-06-2006, 04:49 AM
If you've truly made the modifications described here:

http://www.dynamicdrive.com/forums/showpost.php?p=56485&postcount=2

Then all you need to do is to set up an array of your captions:


var caps=[];
caps[0]="This is a picture of me~"
caps[1]="This is a second image"

and so on for however many you need. Put that array at the top of the script, before anything else (but after the opening <script> tag). Then, in this part of the previous modification add (additions red):


ddiv.innerHTML = Message+'<br>'+caps[CurrentSlide];

yujinoen
12-06-2006, 09:56 PM
YAY~It works perfect!!!

John~Thank you soooooo much!

and I kinda edit the new script you gave me to show the text description in another column)

luckily,it worked~
(I didn't even expect that my editiing could work since I have no idea about java)

ddiv.innerHTML = Message;
ddiv2.innerHTML = caps[CurrentSlide];

<div id="ddiv"></div>
<div id="ddiv2"></div>

again, thank you so much for the fast reply and for your GREAT HELP!!!

jscheuer1
12-06-2006, 10:48 PM
Well, that will work in IE but, for other browsers you need to include this line:


var ddiv2=document.getElementById? document.getElementById('ddiv2') : document.all['ddiv2'];

Just below this one:


var ddiv=document.getElementById? document.getElementById('ddiv') : document.all['ddiv'];