Topic: Multiple Galleries positioned side by side [SOLVED]

Hi

I have set up a webpage with multiple galleries. I have the gallery width set at 50% and i am looking to have 2 galleries side by side and then the third would go below number 1 etc. At the moment they appear one on top of the other.

Can you tell me if it is possible to have a page with effectively two columns of galleries rather than them all stacked on top of each other and what i would need to change to make it work?

Thanks for your help

Kind Regards
Jason

Re: Multiple Galleries positioned side by side [SOLVED]

If you want to display two divs side by side, you could wrap then in a container div and float one of them left and the other one right.

To see this in action, create two sample galleries with JuiceboxBuilder-Lite.
Save one gallery in a folder named 'gallery1' and the other in a folder named 'gallery2'.
Now create a new HTML file with the code below, name it whatever you like, place it in the same directory as the two gallery folders and open it in a browser.

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Juicebox-Pro Gallery</title>
    <meta charset="utf-8" />
    <meta name="viewport" id="jb-viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1, user-scalable=0" />
    <style type="text/css">
    body {
        margin: 0px;
    }
    #wrapper {
        width: 100%;
    }
    #juicebox-container-1 {
        float: left;
    }
    #juicebox-container-2 {
        float: right;
    }
    </style>
</head>
<body>
    <script src="gallery1/jbcore/juicebox.js"></script>
    <script>
    new juicebox({
        baseUrl: 'gallery1',
        containerId: 'juicebox-container-1',
        galleryWidth: '50%',
        galleryHeight: '100%',
    });
    </script>
    <script>
    new juicebox({
        baseUrl: 'gallery2',
        containerId: 'juicebox-container-2',
        galleryWidth: '50%',
        galleryHeight: '100%',
    });
    </script>
    <div id="wrapper">
        <div id="juicebox-container-1"></div>
        <div id="juicebox-container-2"></div>
    </div>
</body>
</html>

Re: Multiple Galleries positioned side by side [SOLVED]

Thanks Steven, i'll give this a try.

Regards
Jason

Re: Multiple Galleries positioned side by side [SOLVED]

Hi Steven

This worked a treat for me, thank you for your help.
I just noticed something though when viewing on a mobile (iphone 4s). I have added 4 galleries on to the page (www.prophotocompany.co.uk/propertyimages.php) and initially they all look fine but once i move the page down gallery one resizes to fit the screen and gallery 2 is slightly larger than the screen and makes the screen out of sync. I've checked as much as i can and can't see any reason why its doing it and wondered if you could see why its happening?

I tried to attached a picture but couldn't work out how to but can send if you require it.

Regards
Jason

Re: Multiple Galleries positioned side by side [SOLVED]

Here are a couple of things to try:

(1) Try giving your gallery fixed pixel heights instead of percentages.
There can be problems using percentage heights under certain circumstances. Please see the Using Percentage Heights support section for details.
For example, try changing all instances of:

galleryHeight: "80%",

... to something like:

galleryHeight: "600",

(2) Instead of having one wrapper:

<div id="juiceboxwrapper">
    <div id="juicebox-container1"></div>
    <div id="juicebox-container2"></div>
    <div id="juicebox-container3"></div>
    <div id="juicebox-container4"></div>
</div>

... try using two separate wrappers, each with only two galleries (one floated left, the other floated right):

<div id="juiceboxwrapper1">
    <div id="juicebox-container1"></div>
    <div id="juicebox-container2"></div>
</div>
<div id="juiceboxwrapper2">
    <div id="juicebox-container3"></div>
    <div id="juicebox-container4"></div>
</div>

Hopefully one of these suggestions will help.

Re: Multiple Galleries positioned side by side [SOLVED]

Thank you once again Steven, the two separate wrappers option worked great.

Thanks
Jason

Re: Multiple Galleries positioned side by side [SOLVED]

I'm glad that worked. Thank you for letting me know.