PDA

View Full Version : Possible to create a dyamic string for gallery images?



jamesshall
01-08-2008, 09:13 AM
1) Script Title: Advanced Gallery

2) Script URL (on DD): Advanced Gallery (http://www.dynamicdrive.com/dynamicindex17/agallery.htm)

3) Describe problem: Currently I am toying with the advanced gallery to see if I can use it to keep track of a list of about 60 images. I have added an area that changes text descriptions along with each image.

After looking at the final HTML, I see that it's getting very puffed up so I got to thinking (ouch! my head!)
I would like to construct a string that would complete each image URL, but I have no idea if this is even possible in Java.

Right now my HTML contains about 60 repeats of the following
<div class="gallerycontent" subject="10004">
<img src="/Images/10004-1.jpg"></div>

... it goes on and on (60 images).

Would it be possible to somehow just have 60
<div class="gallerycontent" subject="10005">
and then with some fancy scripting so that a string could be constructed to do
img src="/Images/ + DIV subject (or name) + .jpg"
???

It would really help clean up some of the code and maybe even allow specific subject matter to be addressed.
Maybe a radio button could be added that would jump to a different div class like
<div class="cats"> and <div class="dogs">

The prefix of the string could change accordingly to
img src="/Images/Cats/
And then utilze corresponding div subjects (<div class="cats" subject="10001">) to fill in the string.