• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Help with a Java slideshow

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

BPM

Member
Joined
Sep 19, 2003
Location
Fort Worth, TX
I developed the following slideshow for a website I did for a local flooring business. I accomplished the main goal (to make viewing and cycling through the images easier).

However, I'd like to put a label below (or above) each picture that tells the type of flooring and other information. If I was lazy and unprofessional, I'd just add this to each image :p Basically, I want information that is specific to each picture to be displayed with that picture.

Here's what I have so far:
http://www.andersen-flooring.com/image_navigator.htm
 
It's very simple to do this. Surround your label (just the text) with <div id="caption">[text]</div>".

Make an array with all of the captions We'll call it "captions". Then add the following to your function (right after "document.mypic.src"):

document.getElementById("caption").innerHTML = captions[thisPic];

You can put html in your captions and it will work fine. i.e. make one caption red and one blue.

Any more help and I might have to start charging you :p or you can hire me...

and btw, I noticed on the rest of the site (wanted to see what it was), the nav bar is messed up one a few of the pages. the thing that changes color ends up being wrapped to below the link.
 
kayson said:
It's very simple to do this. Surround your label (just the text) with <div id="caption">[text]</div>".

Make an array with all of the captions We'll call it "captions". Then add the following to your function (right after "document.mypic.src"):

document.getElementById("caption").innerHTML = captions[thisPic];

You can put html in your captions and it will work fine. i.e. make one caption red and one blue.

Any more help and I might have to start charging you :p or you can hire me...

and btw, I noticed on the rest of the site (wanted to see what it was), the nav bar is messed up one a few of the pages. the thing that changes color ends up being wrapped to below the link.
Thanks!

...and good catch. Looks like yet another FireFox/bad coding issue :rolleyes:
 
Ok, the slideshow is done. I ended up using 4 arrays total. 1 for the pictures, and one for each field in the type of flooring (brand, color, etc.).

I placed the ID for the arrays in table cells so each field would be updated with each picture. Worked out pretty well, although it was time consuming adding all the information to the new arrays:

http://www.andersen-flooring.com/image_navigator.htm

The only thing that's bugging me right now is the font. I need to figure out a way to make it consistent w/the rest of the page.
 
Back