My goal is to create essentially two galleries on a single page, in which the first gallery determines what the second gallery displays. For instance, the first gallery refers to the contents of the main image folder. The second gallery would be a folder inside the main image folder. Depending on which image is displayed, the first gallery's image would trigger the second gallery's contents. I suppose this is sort of a hierarchal gallery system. Is this somewhat easily possible in javascript or would it be more feasible to execute in flash/xml? Thanks.
Hierarchical Image Gallery
Collapse
X
-
It should be possible, but will be made easier if the code is generated properly from the server-side. Store the second gallery image sources in arrays. When an image changes in the first gallery (onclick?), load the second gallery from the corresponding array. To do that, use another array to map the first gallery images to its set of images in the second gallery. To change images, change the src property of the images. There are other alternatives to this too, e.g. storing in XML and using JavaScript to parse the file.
Comment