PDA

View Full Version : lightbox array image count problem



segfaultii
09-10-2009, 12:25 PM
Situation:
I have a gallery with thumbnails on the right and a preview on the left. The preview gets updated when you click on a thumbnail.
Above the preview is a "view large" button that opens the lightbox:


<a id="switchZoomImage" onmouseover="showHide('zoom-img');" onmouseout="showHide('zoom-img');"
href="http://dynamic_path/image1.jpg" rel="lightbox[roadtrip]">
<img src="http://path/zoom-button.png" alt="" title="" />
</a>
The gallery is filled dynamically from a folder.

My problem is that lightbox counts from the image you selected forward and not back, so for example when you click on image 3 it says "Image 1 of 10". The "next" and "prev" buttons are affected in the same way, I can only go forward and back to that image that was selected from the thumbs.

The code is generated via SmartyPhp, so that the paths are all dynamic. Heres the generated html:

<a href="http://path/image2.jpg rel="lightbox[roadtrip]"></a>
<a href="http://path/image3.jpg rel="lightbox[roadtrip]"></a>
<a href="http://path/image4.jpg rel="lightbox[roadtrip]"></a>
...
When I view the code in the browser I have my list of <a>'s all with rel="lightbox[roadtrip]" so it should work but doesn't.

How can I fix this?