I have a page where some parts are updated via AJAX. These parts may contain Shadowbox links, so I call Shadowbox.setup() after the update, but unfortunately each call doubles the number of entries in the gallery, as the new nodes don't have a shadowboxCacheKey property.
In my scenario the updated HTML may also contain less images than the original, i.e. images can be removed from a gallery. I think an easy way to achieve this would be to have a Shadowbox.reset() method that clears the internal cache array.
Do you think it would be feasible to add such a method in the next release or am I missing something here?
Thanks for your help and this truly beautiful library,
Can you show an example to how to get this to work properly? I am also doing something similar. I have tried the following with varying levels of success:
// turns shadowbox off, but does not add reset it
// ditto, no shadowbox
// Adds the new image to the end of the array (I would prefer to choose where it is inserted), but dimensions are wrong for image (box is normally fills the screen when displaying the new image)
Thanks for you help. I have a similar issue with removing an image from shadowbox when an image is deleted from the gallery.
I ran into the same problem, however, it worked for me using Shadowbox.setup().. I updated to the newest version today (4/2/08, v1.0), as I had been using a beta release that did not have the clearCache() function.
I don't know why you had trouble using Shadowbox.setup(). The only suggestion I have is look for a post on this forum about a hack to fix the clearCache() function. The author changed line 2285 from: