Topic: Multiple galleries - config issue

Hi there,

My goal is to have two galleries launched from the index/splash page. I've made 2 separate gallery folders for Live and Travel. Each folder contains a config.xml file for each gallery in order to route the image paths. I am receiving errors like: 'the container id cannot be found', 'the xml file cannot be found' or a blank screen will remain.

I've been reading the support page, troubleshooting, using the 'baseUrl' as well as the 'configUrl' taxonomy and still no luck. Does the config.xml file need to be in the root folder along with the index?

Here are the code snippets for each gallery:

Live Gallery

<script src="live/jbcore/juicebox.js"></script>   
<script type="text/javascript">
new juicebox({
configUrl: "http://emmamasseyphoto.com/live/config.xml",           
containerid:"livecontainer1",
backgroundColor:"rgba(0,0,0,0.9)",
galleryTitle: "Live",
showSplashPage: "ALWAYS",
showOpenButton: "false",
galleryTitlePosition: "NONE",
showThumbsOnLoad: "false",
imageTransitionType: "CROSS_FADE",
captionPosition: "OVERLAY_IMAGE",
imageNavPosition: "IMAGE"
});
</script>
<div id="livecontainer1"></div>
<!--END JUICEBOX EMBED-->


Travel Gallery

<script src="travel/jbcore/juicebox.js"></script>   
<script type="text/javascript">
new juicebox({
configURL: "http://emmamasseyphoto.com/travel/config.xml",
containerid:"travelcontainer",
backgroundColor:"rgba(0,0,0,0.9)",
galleryTitle: "Travel",
showSplashPage: "ALWAYS",
showOpenButton: "false",
galleryTitlePosition: "NONE",
showThumbsOnLoad: "false",
imageTransitionType: "CROSS_FADE",
captionPosition: "OVERLAY_IMAGE",
imageNavPosition: "IMAGE"
});
</script>
<div id="travelcontainer"></div>
<!--END JUICEBOX EMBED-->

Also, here are two links of what I'm trying to achieve:
http://www.juicebox.net/demos/pro/splash/
http://www.juicebox.net/demos/support/m … _one_page/

Thanks for your time, any help would be greatly appreciated!

Re: Multiple galleries - config issue

Here are a few tips which should help you get your galleries working as expected:

(1) Load the 'juicebox.js' file only once per web page (not once per gallery).

(2) Unless your galleries are nested within parent containers which have been given dimensions via CSS, set gallery dimensions in the embedding code. As you do not currently set dimensions, default values of 100% will be used for both the width and height and unless Juicebox can determine when the 100% refers to, you may have problems with gallery sizing. Try using something like:

galleryWidth: '100%',
galleryHeight: '600',

(3) If you have uploaded your entire gallery folders ('live' and 'travel' to your web server), then I would recommend using a baseUrl (to point to your gallery folder) instead of a configUrl. If you use only a configUrl, then the paths to the images within the 'config.xml' file may be incorrect (unless you have edited them manually).

(4) Use relative paths for the configUrl or baseURL. If you hardcode the emmamasseyphoto.com domain in the path, then your gallery will not display if a visitor goes to the www.emmamasseyphoto.com subdomain

I do not see any problem with the containerId entries in the code you posted so you should not be getting any "Cannot find div with id" messages.

Try the following and if it does not work, please double-check that the entire 'live' and 'travel' gallery folders have been uploaded to your root directory.

<script src="/live/jbcore/juicebox.js"></script>   

<script type="text/javascript">
    new juicebox({
        baseUrl: "/live/",           
        containerid: "livecontainer1",
        backgroundColor: "rgba(0,0,0,0.9)",
        galleryTitle: "Live",
        showSplashPage: "ALWAYS",
        showOpenButton: "false",
        galleryTitlePosition: "NONE",
        showThumbsOnLoad: "false",
        imageTransitionType: "CROSS_FADE",
        captionPosition: "OVERLAY_IMAGE",
        imageNavPosition: "IMAGE",
        galleryWidth: "100%",
        galleryHeight: "600"
    });
</script>
<div id="livecontainer1"></div>

<script type="text/javascript">
    new juicebox({
        baseUrl: "/travel/",
        containerid: "travelcontainer",
        backgroundColor: "rgba(0,0,0,0.9)",
        galleryTitle: "Travel",
        showSplashPage: "ALWAYS",
        showOpenButton: "false",
        galleryTitlePosition: "NONE",
        showThumbsOnLoad: "false",
        imageTransitionType: "CROSS_FADE",
        captionPosition: "OVERLAY_IMAGE",
        imageNavPosition: "IMAGE",
        galleryWidth: "100%",
        galleryHeight: "600"
    });
</script>
<div id="travelcontainer"></div>

If you continue to experience difficulties, please post the URL to your web page so that I can take a look and help further.

Re: Multiple galleries - config issue

Hi Steven,

Thank you for your help in resolving this issue. I've followed the suggested tips + new code and still am still receiving a grey screen with the error message??

Here is a link to the test site: emmamasseyphoto.com/test.html

Thanks again for your help with this.

Re: Multiple galleries - config issue

Your galleries themselves seem to be OK. The 'config.xml' files and images seem to be in the correct locations on your web server. The problem seems to be with your embedding page.

When I load your web page, it initially seems to load OK but then some code on your web page appends #home to the URL and this is when the 'Juicebox Error: Cannot find div with id: "travelcontainer"' message is displayed and the browser fails to load the page (with a continuous spinning icon in the browser tab).

First of all, try fixing the errors on your web page so that the code on your web page validates correctly.
You can check the code on your web page with the W3C Markup Validation Service and then fix the errors reported.

Also, try removing whatever code is adding #home to the URL when the web page loads to see if this helps.

Re: Multiple galleries - config issue

I've fixed up some of the code, but honestly when I first posted this, it worked when only one gallery is used; I only receive the message when trying to load 2 or more galleries.

I am still receiving an error message.

Re: Multiple galleries - config issue

It looks like the root of your problem lies with your external 'parallax.js' JavaScript file.
When it is loaded in your web page, it removes (rather than just hides) the following elements from your web page's Document Object Model (DOM).

story-home
story-live
story-travel
story-explore
story-about
story-contact

Your 'Live' gallery's container ('livecontainer') is within the 'story-live' <section> and your Travel gallery's container ('travelcontainer') is within the 'story-travel' <section>.
When Juicebox tries to loading the galleries into the respective gallery containers, the containers no longer exist on the web page because they have been removed by the code within 'parallax.js'.

The comment on your main web page regarding the 'parallax.js' file suggests that it may cause problems :

<!-- parallax.js really screws with the DOM, so make sure it's included last so other things don't notice :) -->

I do not know exactly how your web page has been designed to function (over 12 external CSS and JavaScript files are loaded on your page so it is difficult to see exactly what is going on) but if your web page somehow reinstates the elements which were initially removed by 'parallax.js' (perhaps when links are clicked), then the solution to your problem would be to delay loading your galleries until such a time that the required gallery containers are present and part of the DOM.
You could put your gallery's embedding code into a JavaScript function and run the function when a link is clicked using a jQuery .click() handler (as your web page already loads and uses jQuery).

Otherwise, an alternative would be to fiond a solution which does not use 'parallax.js'.

I've fixed up some of the code, but honestly when I first posted this, it worked when only one gallery is used;

This might be because 'parallax.js' removes DOM elements which are not initially displayed on screen (initially hidden by and accessed via a menu system) when the web page is loaded.