Topic: Force Main Image Height

Hello, hopefully this isn't already answered but I could not find any posts exactly regarding this.

Can the main image be set to fill the width of the screen so it pushes down the page? It's hard to explain but if I view a gallery in a 1024 or 800px resolution the main image is very small and does not push the footer down. In other words it just uses the space that's there no matter how small it is. This is a HTML embeded gallery so maybe it needs to be presented differently.

Browser 1920px
http://web-2-images.s3.amazonaws.com/juicebox1920.jpg
Browser 800px more extreme example to show example.
http://web-2-images.s3.amazonaws.com/juicebox800.jpg

Thank you

Re: Force Main Image Height

A gallery's height can be expressed as either:
(1) an absolute fixed pixel value, or...
(2) a percentage (of the height of the gallery's parent container).

In either case, the size of the gallery (the 'juicebox-container' <div>) will not change depending on the height of the image it is currently displaying.
This is no different than setting the height of any other <div> on a web page.

By default, Juicebox-Pro will display the image as large as possible within the gallery's image area without cropping.
You can change the way that the image is displayed within the image area through use of the imageScaleMode configuration option (in JuiceboxBuilder-Pro's 'Customize -> Main Image' section) but changing imageScaleMode will not change the height of the gallery.
For example, you could set imageScaleMode="FILL" which will fill the image area but will crop the image if the image and the image area do not have the same aspect ratio.

If you really want to dynamically change the height of the gallery depending on the dimensions of the image being displayed, you could use the Juicebox-Pro API (specifically the onImageChange event and the getGalleryInfo method) to get the URL of the current image.
You could then use JavaScript to get the dimensions of the image and determine the new height for the gallery.
Then, you could set the gallery's height accordingly using the Juicebox-Pro API setGallerySize method.

Here is an sample 'index.html' page which you could modify to suit your needs:

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Juicebox-Pro Gallery</title>
        <meta charset="utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <style type="text/css">
            body {
                margin: 0px;
            }
        </style>
    </head>
    <body>
        <!--START JUICEBOX EMBED-->
        <script src="jbcore/juicebox.js"></script>
        <script>
            jb = new juicebox({
                containerId: 'juicebox-container',
                galleryWidth: '600',
                galleryHeight: '400',
                imageScaleMode: 'FILL'
            });
            jb.onImageChange = function(e) {

                var index = e.id;
                var info = jb.getImageInfo(index);
                var url = info.imageURL;

                var image = new Image();
                image.src = url;

                var height = image.height;
                var width = image.width;

                var newHeight = Math.floor((600/width)*height) + 95;

                jb.setGallerySize('600', newHeight);

            }
        </script>
        <div id="juicebox-container"></div>
        <!--END JUICEBOX EMBED-->
    </body>
</html>

Re: Force Main Image Height

Hi Steven, thanks for your thorough reply. I may look into some of these solutions.

For now I would like to try the full version Full Browser but don't see how to accomplish this. The embed guide states this but doesn't give the details on how to do it. Sorry, I have looked for this before posting here.
Embed Sizes

A Juicebox gallery can be embedded as Full Browser or Embedded.

    Full Browser means the gallery fills 100% of the browser window.
    Embedded means the gallery is a fixed size element in a bigger HTML page (e.g. a small gallery in a blog). Embedded galleries display the Expand button which allows the user to expand the gallery to fill the browser window and display the images at higher resolution.

I think this would be a good solution for smaller screens. Would you point me to the instructions on doing this in a HTML page?

Thanks again, great product by the way.

Re: Force Main Image Height

I believe I found it. I did not notice in the Load Presets the drop down. Is this the only way to do this?

Re: Force Main Image Height

I see, I need to link the menu item to the JB gallery page and then add the index.html URL to the home button. Perfect!

Thanks

Re: Force Main Image Height

Everything is great except the home button doesn't show on my phone. Razr HD using Chrome or Dolphin browsers.

Re: Force Main Image Height

For now I would like to try the full version Full Browser but don't see how to accomplish this.

I did not notice in the Load Presets the drop down. Is this the only way to do this?

'Full Browser' (rather than 'Embedded') just refers to the size of the gallery being 100% x 100% (taking up the bull browser window by itself). You can set the gallery's dimensions to 100% x 100% (no matter what preset you load from the drop-down menu) in JuiceboxBuilder-Pro's 'Customize -> Lite' section.
After creating a 100% x 100% gallery, just open the gallery's 'index.html' page in a browser to view the gallery on a page of its own taking up the entire browser window.
If you were to embed the gallery in an existing web page alongside other content, then you could allow users to view the gallery fullscreen by setting showExpandButton="TRUE". On clicking the Expand Button on the Button Bar, the gallery will expand to fill the browser window.

I see, I need to link the menu item to the JB gallery page and then add the index.html URL to the home button. Perfect!

Yes. That will work fine.

Everything is great except the home button doesn't show on my phone.

Set showSmallBackButton="TRUE" (in JuiceboxBuilder-Pro's 'Customize -> Back Button' section) to show the Back Button in Small Screen Mode (which is used by Juicebox to display the gallery on small screen devices).
For more information about how Juicebox adapts to different devices and screen sizes, please see here.