Is there a way to add an event listener to detect when the user exits the gallery?
Ordinarily, you could use the onExpand(expanded) event from the Juicebox-Pro API as follows:
<!--START JUICEBOX EMBED-->
<script src="jbcore/juicebox.js"></script>
<script>
var jb = new juicebox({
containerId: 'juicebox-container',
galleryWidth: '800',
galleryHeight: '600'
});
jb.onExpand = function(expanded) {
if (expanded) {
//Gallery has been expanded. Do something.
}
if (!expanded) {
//Gallery has been closed. Do something else.
}
}
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->Unfortunately, the onExpand(expanded) event is not fired when the gallery is closed having been expanded from a Splash Page. It works only when the gallery has been expanded from the actual gallery display itself.
To clarify (please let me know if this is correct):
Expand gallery -> Rotate device -> Close gallery => Splash page is "cropped and left justified" (until device is rotated again or page is zoomed)
Happens only on Android and Windows mobile devices and only when gallery is nested within parent container.
It certainly might help if I could see exactly what you are seeing so please upload some screenshots somewhere and let me know what devices and browsers you are using and see the problem in.
I may not be able to suggest a fix (it sounds like you have already tried everything that I think might help) but at least I can notify the developers with as much information about the problem as possible.
Thank you.