View Full Version : JavaScript picture navigation by DIV boxes

02-09-2006, 07:04 AM
I am trying to put together a couple of pages with pictures that I would like to be navigable by buttons.

I have "categorized" the pictures by putting them in a multi-dim array, called "albums", and I have a thumb picture of each album, so when I click that album thumb, the first picture of that album displays in a DIV box. I also have a "Previous" and "Next" image (arrows), so that when I click either, the DIV box shows the previous or next image in that album sub array.

So far so good.

What I would like is that everytime I click one of those album thumbs, is a neat little row of square boxes with a number inside them (1 - [number of pics in album]), which are also clickable, i.e. when I click on say the little box saying "6", picture #6 of the album being displayed is displayed.

I would like to put these "number boxes" inside a DIV element/box, so I'm essentially looking for a way to clear that DIV element whenever a new album is selected (which I think should be possible by innerHTML='' or similar), and some way to actually populate this DIV element with the boxes, including code that will enable me to display the respective image when a box/button is clicked...

02-09-2006, 09:28 AM
you must use DOM methods to do that, rather than the nonstandard innerHTML.