[thelist] Photos

Keith Davis cache at dowebs.com
Fri May 25 13:02:58 CDT 2001

Kevin Stevens wrote:

> question. I had invisaged having a page with background and nav bar and
> working out the code so that just the picture changes without re-loading the
> whole page.

> I could have fields for
> the dimensions, alt tags, brief description etc. 

You can do a slide show all on one page using different images of
different sizes, each displaying it own description etc. Just place each
image-discription-etc display in a div and give it "hidden" visibility.
Be sure to position each div in the same area so they are arranged in an
invisible stack. Then list each div id in an array. 

When visitor clicks "next" loop through the array giving "hidden" to all
divs and then end by giving "visible" to the next div in the array. Be
sure to capture the array ordinal position of that image in a global
variable so you can increment to "next" or decrement to "previous" on
the next click.

Ah, but you don't want all of those images to have to load with the
page, you want them to load as they are called. No problem. In your div
specify a 1 pixel transparency where the image goes and give the image a
name. When you give the div "visibile" also do a rollover on that image
name calling the real image from the server. Do not preload those

This isn't as hard as it sounds. I do this a little differently at
http://allidaho.com. There the visitor clicks an ad spot in one frame
that sends the visible and rollover commands to a different frame. The
point is, the ad billboard that loads in the other frame is in a div
which takes visibility and rolls the image over to call the
corresponding ad billboard off the server. You can toggle back and forth
from billboard to billboard and it all happens without changing or
reloading the page that the slide show takes place on. Although the
entire tabset there is database driven that is not because a database is
required for the slide show effect, the database exits so that the owner
can change the ads and tabset parameters through his browser.


More information about the thelist mailing list