Topic: Hide thumbs on fullscreen mode

Hi,

I´m using Juicebox 1.4.4.2. This is an example of the embed code generated by juicebox (followed by noscript commands):

<!--START JUICEBOX EMBED-->
<script src="jbcore/juicebox.js"></script>
<script>
new juicebox({
containerId: "juicebox-container",
galleryWidth: "100%",
galleryHeight: "100%",
backgroundColor: "rgba(51,51,51,1)"
});
</script>
<div id="juicebox-container">

...

Is it possible to hide thumbnails when the gallery is expanded in fullscreen mode?

Thanks and bye

Dirk

Re: Hide thumbs on fullscreen mode

It would not be possible to do this via the available configuration options.
However, you could use the Juicebox-Pro API to check whether or not the gallery is in expanded mode (via the onExpand(expanded) event) and toggle the thumbnails if necessary (via the toggleThumbs() method). You can keep track of whether or not the thumbnails are currently visible (for example if you choose to activate the Thumbnail Button and allow the user to toggle the thumbnails on and off) via the onShowThumbs(showing) event.

Here is an example of how this might be achieved.
To see the example in action, create a sample gallery with JuiceboxBuilder-Pro and replace the gallery's 'index.html' file with the code below.

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <style type="text/css">
            body {
                margin: 0px;
            }
        </style>
        <script type="text/javascript" src="jbcore/juicebox.js"></script>
        <script type="text/javascript">
            var thumbs = true;
            var jb = new juicebox({
                containerId: "juicebox-container",
                galleryHeight: "400",
                galleryWidth: "600",
                screenMode: "LARGE",
                showExpandButton: "TRUE",
                showThumbsButton: "FALSE",
                showThumbsOnLoad: "TRUE"
            });
            jb.onExpand = function(expanded) {
                if ((expanded && thumbs) || (!expanded && !thumbs)) {
                    jb.toggleThumbs();
                }
            };
            jb.onShowThumbs = function(showing) {
                thumbs = showing;
            };
        </script>
        <title>Test</title>
    </head>
    <body>
        <div id="juicebox-container"></div>
    </body>
</html>

I hope this helps.

Re: Hide thumbs on fullscreen mode

Steven wrote:

I hope this helps.

It does - thanks so far.

Only one issue with iOS only (iPad): When I go to fullscreen mode thumbs hide - good. When I return to 'normal' mode thumbs are still invisible - not so good ;-)

Do you have a solution for this?

Thx again.

Re: Hide thumbs on fullscreen mode

My suggestion above works OK in Mobile Chrome and Mobile Safari on my iPod Touch.

However, here are a few thoughts that might help (although please note that Juicebox was not designed with this functionality in mind).

(1) On iOS devices, the gallery will automatically expand in a new page. Please see the Expand Gallery Behavior support section for details.
Try setting expandInNewPage="FALSE" (at least for testing purposes) to see if this makes a difference.

(2) My code above forces the gallery to always be displayed in Large Screen Mode. If you want to retain Small Screen Mode for mobile devices, you could try the following:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <style type="text/css">
            body {
                margin: 0px;
            }
        </style>
        <script type="text/javascript" src="jbcore/juicebox.js"></script>
        <script type="text/javascript">
            var thumbs = true;
            var jb = new juicebox({
                containerId: "juicebox-container",
                galleryHeight: "400",
                galleryWidth: "600",
                screenMode: "AUTO",
                showExpandButton: "TRUE",
                showThumbsButton: "FALSE",
                showThumbsOnLoad: "TRUE",
            });
            jb.onInitComplete = function (){
                var screenMode = jb.getScreenMode();
                if (screenMode === 'LARGE') {
                    jb.onExpand = function(expanded) {
                        if ((expanded && thumbs) || (!expanded && !thumbs)) {
                            jb.toggleThumbs();
                        }
                    };
                    jb.onShowThumbs = function(showing) {
                        thumbs = showing;
                    };
                }
            };
        </script>
        <title>Test</title>
    </head>
    <body>
        <div id="juicebox-container"></div>
    </body>
</html>

(3) There may also be a timing issue. Introducing a short delay (such as one second in the code below) before toggling the thumbnails might help. (It might not be an ideal solution but doing so should at least tell us whether this is the root of the problem or not.)

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <style type="text/css">
            body {
                margin: 0px;
            }
        </style>
        <script type="text/javascript" src="jbcore/juicebox.js"></script>
        <script type="text/javascript">
            var thumbs = true;
            var jb = new juicebox({
                containerId: "juicebox-container",
                galleryHeight: "400",
                galleryWidth: "600",
                screenMode: "LARGE",
                showExpandButton: "TRUE",
                showThumbsButton: "FALSE",
                showThumbsOnLoad: "TRUE"
            });
            jb.onExpand = function(expanded) {
                if ((expanded && thumbs) || (!expanded && !thumbs)) {
                    setTimeout(function() {
                        jb.toggleThumbs();
                    }, 1000);
                }
            };
            jb.onShowThumbs = function(showing) {
                thumbs = showing;
            };
        </script>
        <title>Test</title>
    </head>
    <body>
        <div id="juicebox-container"></div>
    </body>
</html>

If you continue to experience difficulties, then please post the URL to your gallery's web page so that I can take a look and hopefully help further.
Please also let me know what version of iOS your device runs and what browser(s) the problem occurs in (Mobile Chrome, Mobile Firefox, Mobile Safari). Thank you.

Re: Hide thumbs on fullscreen mode

Hi Steven,

first of all thanks for the excellent support - I really appreciate this.

Now a few comments:

(1) On iOS devices the gallery does not automatically exapnd in a new page. At least not on my iPhone and iPad with latest iOS version.
(2) Unfortunately the timing approach you provided does not work - actually it worsens things as now thumbs are always visible.

Please have a look at:

http://www.usaletsgo.de/poi_rhyolite.ph … te#gallery

The gallery at the bottom of the page works just fine. But on iOS the thumbs are hidden if expanded (good) and do not return if the expanded is exited (not good) ;-)

The gallery is displayed in large screen mode as I ran into problems with 'auto mode' on iphone only.

Thanks again und looking forward to hearing from you.

Bye, Dirk

Re: Hide thumbs on fullscreen mode

(1) Your gallery does expand in a new page when I expand it on my own iOS device.
When expanded, the gallery is displayed by the 'full.html' page instead of on top of the embedding page ('poi_rhyolite.php').

(2) OK. Thank you for trying. It was worth it to see what happens. (I still think that a timing issue may somehow be contributing to your problem.)

I've viewed your gallery in Mobile Chrome and Mobile Safari on my iPod Touch and the 'hide thumbnails' functionality works as expected in both browsers.

Try the following simplified code which does not wait for the onShowThumbs(showing) event to be fired before flipping the value of the thumbnail tracking variable.

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <style type="text/css">
            body {
                margin: 0px;
            }
        </style>
        <script type="text/javascript" src="jbcore/juicebox.js"></script>
        <script type="text/javascript">
            var jb = new juicebox({
                containerId: "juicebox-container",
                galleryHeight: "400",
                galleryWidth: "600",
                screenMode: "LARGE",
                showExpandButton: "TRUE",
                showThumbsButton: "FALSE",
                showThumbsOnLoad: "TRUE"
            });
            jb.onExpand = function(expanded) {
                if ((expanded && thumbs) || (!expanded && !thumbs)) {
                    jb.toggleThumbs();
                    thumbs = !thumbs;
                }
            };
        </script>
        <title>Test</title>
    </head>
    <body>
        <div id="juicebox-container"></div>
    </body>
</html>

Also, as your gallery does not display the Thumbnail Button at all, there should be no need to check the visibility of the thumbnails. (They should always be visible in normal mode and always be hidden in expanded mode.) Therefore, you could try the following:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <style type="text/css">
            body {
                margin: 0px;
            }
        </style>
        <script type="text/javascript" src="jbcore/juicebox.js"></script>
        <script type="text/javascript">
            var thumbs = true;
            var jb = new juicebox({
                containerId: "juicebox-container",
                galleryHeight: "400",
                galleryWidth: "600",
                screenMode: "LARGE",
                showExpandButton: "TRUE",
                showThumbsButton: "FALSE",
                showThumbsOnLoad: "TRUE"
            });
            jb.onExpand = function(expanded) {
                jb.toggleThumbs();
            };
        </script>
        <title>Test</title>
    </head>
    <body>
        <div id="juicebox-container"></div>
    </body>
</html>

Re: Hide thumbs on fullscreen mode

Unfortunately the code snippets you posted don´t work either.

Maybe you can put this issue on the agenda for an official update of juicebox builder.

The main reason for my interest in this issue is that if you display your gallery in expanded mode the thumbs take away too much space on mobile small screen devices such as an iphone.

Re: Hide thumbs on fullscreen mode

Perhaps the best course of action would be to set showThumbsButton="TRUE" (in JuiceboxBuilder-Pro's 'Customize -> Lite' section) and allow visitors to your web site to toggle the thumbnails on and off as required.
You could then post your suggestion in the Feature Requests thread.
I do not now which ideas will be implemented in future versions but posting in this thread keeps all the ideas together and ensures that they are not overlooked by the developers.

The main reason for my interest in this issue is that if you display your gallery in expanded mode the thumbs take away too much space on mobile small screen devices such as an iphone.

This is why Small Screen Mode exists. In Small Screen Mode, the thumbnails and main images are displayed on different pages (never together) to give more space to the main images on small screen devices.
Perhaps you could give screenMode="AUTO" ('Customize -> General') another try.
If you do not want to use the Splash Page (which Small Screen Mode uses by default when a gallery is embedded in a web page alongside other content), then you could set showSplashPage="NEVER" ('Customize -> Splash Page').

For reference, more information about Screen Modes and the Splash Page can be found here.

9 (edited by dirk 2016-02-02 16:13:04)

Re: Hide thumbs on fullscreen mode

Steven wrote:

Perhaps you could give screenMode="AUTO" ('Customize -> General') another try.

Please have a look at http://www.usaletsgo.de/test.php

The gallery at the bottom of the page is in auto screen mode. The left part of the first image is cut on my iPhone (iOS 9.2.1). If I switch to large screen mode everything is fine.

Re: Hide thumbs on fullscreen mode

If you are referring to the Splash Page image (the image that you tap to expand the gallery in Small Screen Mode), then, by default, Juicebox uses the first image image the gallery and center-crops it to fit the gallery area. The first image in the gallery itself (after the Splash Page is tapped) is not cropped. It is displayed in its entirety with its aspect ratio respected.

You could set a specific image for the Splash Page (perhaps more appropriate to the aspect ratio of your gallery) via the splashPageUrl ('Customize -> Splash Page') configuration option.

Otherwise, you could choose to not use the Splash Page by setting showSplashPage="NEVER", in which case, visitors to your web site will initially be presented with the thumbnail page. If you wanted to, you could then set showSmallThumbsOnLoad="FALSE" ('Customize -> Thumbnails') to initially display the first image in the gallery instead of the thumbnail page.

For reference, a list of Splash Page configuration options can be found here.