I’ve been trying to modify some existing code by adding Next/Previous links…
I seem to be having trouble within the nextImage() and prevImage() functions. Even though I’ve figured out how to get the HREF of the next item in the anchor link sequence, I’m not getting the page to update properly (displaying the next/previous thumbnail in a selected state, and the main image updated to the corresponding image). Using alert boxes, I can tell that the URL I’m passing is correct, but I’m not sure why the functionality dies at that point. Any help would be appreciated.
http://www.burntscarlet.com/_test/gallery_jQuery/includes/gallery.jsThis is the HTML code for the links:
- <div id="gallery-next-prev"><p><a id="previous" href="">< Previous</a> <a id="next" href="">Next ></a></p></div>
And the HTML code for the thumbnail grid looks like this:
- <div id="g_thumbs">
- <a href="_gallery/images/painting/wip_1.jpg" title="Oil Painting 1"><img src="_gallery/thumbs/painting/wip_1.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_2.jpg" title="Oil Painting 2"><img src="_gallery/thumbs/painting/wip_2.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_3.jpg" title="Oil Painting 3"><img src="_gallery/thumbs/painting/wip_3.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_4.jpg" title="Oil Painting 4" class="last-in-row"><img src="_gallery/thumbs/painting/wip_4.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_5.jpg" title="Oil Painting 5"><img src="_gallery/thumbs/painting/wip_5.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_6.jpg" title="Oil Painting 6"><img src="_gallery/thumbs/painting/wip_6.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_7.jpg" title="Oil Painting 7"><img src="_gallery/thumbs/painting/wip_7.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_8.jpg" title="Oil Painting 8" class="last-in-row"><img src="_gallery/thumbs/painting/wip_8.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_9.jpg" title="Oil Painting 9"><img src="_gallery/thumbs/painting/wip_9.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_10.jpg" title="Oil Painting 10"><img src="_gallery/thumbs/painting/wip_10.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_11.jpg" title="Oil Painting 11"><img src="_gallery/thumbs/painting/wip_11.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_12.jpg" title="Oil Painting 12" class="last-in-row"><img src="_gallery/thumbs/painting/wip_12.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_13.jpg" title="Oil Painting 13"><img src="_gallery/thumbs/painting/wip_13.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_14.jpg" title="Oil Painting 14"><img src="_gallery/thumbs/painting/wip_14.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_15.jpg" title="Oil Painting 15"><img src="_gallery/thumbs/painting/wip_15.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_16.jpg" title="Oil Painting 16" class="last-in-row"><img src="_gallery/thumbs/painting/wip_16.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_17.jpg" title="Oil Painting 17"><img src="_gallery/thumbs/painting/wip_17.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_18.jpg" title="Oil Painting 18"><img src="_gallery/thumbs/painting/wip_18.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_19.jpg" title="Oil Painting 19"><img src="_gallery/thumbs/painting/wip_19.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_20.jpg" title="Oil Painting 20" class="last-in-row"><img src="_gallery/thumbs/painting/wip_20.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_21.jpg" title="Oil Painting 21"><img src="_gallery/thumbs/painting/wip_21.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_22.jpg" title="Oil Painting 22"><img src="_gallery/thumbs/painting/wip_22.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_23.jpg" title="Oil Painting 23"><img src="_gallery/thumbs/painting/wip_23.jpg" alt="" width="58" height="58" /></a>
- <a href="_gallery/images/painting/wip_24.jpg" title="Oil Painting 24" class="last-in-row"><img src="_gallery/thumbs/painting/wip_24.jpg" alt="" width="58" height="58" /></a>
- <div style="clear:both;line-height:0;"> </div>
- </div>