when employing your code, it works well, except I have to switch it to AUTO screen size.
If should work for any value of screenMode. The code should be executed only if screenMode="SMALL" or if screenMode="AUTO" and Juicebox chooses to use Small Screen Mode.
However, the captions still show up in the expanded mode as well, even though you have code in their to hide it.
The code works when the gallery is expanded in the same page. However, on iOS devices, the gallery is expanded in a new page (the 'full.html' file within the 'jbcore' folder). Please see the Expand Gallery Behavior support section for more details.
Try the following (in addition to the code above in your main embedding web page).
Open your gallery's 'jbcore/full.html' file in a plain text editor and change:
<!--START JUICEBOX EMBED-->
<script>
var expanded_jb_gallery = true;
new juicebox({
containerid:'juicebox-container',
galleryHeight:'100%',
galleryWidth:'100%'
});
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->
... to:
<!--START JUICEBOX EMBED-->
<script>
var expanded_jb_gallery = true;
var jb = new juicebox({
containerid:'juicebox-container',
galleryHeight:'100%',
galleryWidth:'100%'
});
jb.onInitComplete = function() {
if (jb.getScreenMode() === 'SMALL') {
$('.jb-area-caption').remove();
}
};
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->
(Further testing today suggests that you may also need to increase the timeout from 500ms to 1000ms in my original code for when the gallery is expanded in the same page.)