Hi Steven, hi all.
Thanks for the answer. Finally I got it to work but having some caveats on iOS that I'd like to share with you and asking for solutions.
The problem when sharing images on Facebook using the image number like http://xyz/mygallery/#5 is that juicebox do not deliver open graph tags (go:url, go:title, ...) for the shared image but for the whole gallery. Because Facebook requires proper set open graph tags, the image can't be shared. The image preview and description does not match the actual image.
The reason for this behavior is simple and easy to follow from the perspective of juicebox: The http selector (#) is evaluated in the user agent via javascript, while the open graph tags are rendered by a static HTML page before javascript is evaluated. It is not easy (I think impossible) to adjust the open graph tags via javascript in a way that Facebook will go fine with it.
My Solution: In cases where I like to have an external link for Facebook, Twitter or somewhat that requires proper set open graph tags, I'm using a different url layout: http://xyz/mygallery/index.php?Img=images%2Fmyimage5.jpg#5. The Img parameter can be evaluated on server side and a proper site with correct open graph tags can be rendered. The # can't be used for that because it isn't passed to the server. For a convenient usage of juicebox, I've overriden the javascript twitter, Facebook, .. handlers. When clicking the Facebook share icon in my gallery, the correct Facebook share URL including the Img parameter is generated. The image name is taken from the config.xml that gets parsed via javascript. On server side there is a index.php file that parses the config.xml file too. It renders the open graph tags dynamically and adds the image title, description and so on to the page. If you reorder or add additional images to the gallery, the image numbers will change. For that case the php script ensures the appropriate image number is used in url by modifying the url. The script ensures that the leading image selector is the Img parameter and not the # http selector.
It took me some hours to getting all these things to run. Finally it works really nice. For those who like to see that in action, can check my private website http://www.sk-sly.de
Now the caveat that seems to be a general problem that has nothing in common with my solution.
URL selectors (#) and juicebox seem not to work on iOS with safari! When entering a url on iOS http://abc..../gallery/#5 always the first image is shown but not the 5th. Please try it with you galleries. It seems that the selector is not evaluated by safari on iOS or something strange inside of the juicebox javascript code happens. On OS X with safari or other browsers everything works properly.
Does anyone know something about this issue? Is this a Safari problem on iOS or is the juicebox code broken here?
A solution for this caveat could be for me to initialize the juicebox java script by a code block that is rendered by my php script. In know on server side exactly which image has to be shown. The problem with that is that the jukebox code is obfuscated and I don't have any idea which variable I could modify to achieve this behavior. Any idea about that?
In general I think that it wasn't the best decision of the juicebox developers to use a http selector (#) as image selector. The selector isn't passed to the server and open graph tags can't be rendered properly. We are running into problems with iOS. Links are not stable because the image order could change by resorting or inserting new images.
Regards!
Sly