Topic: Thumbs left not responsive on window size [SOLVED]

I am trying to get a gallery setup with the thumbs to the left of the main image - it looks fine on a mobile and on a computer when the window is full size or reduced vertically but if I reduced the size of the window horizontally (making it thin) the main image shrinks down to smaller than the thumbs and is then not visible.

Is it possible that if the window is reduced in width that it kicks in the responsive display shown on small screens ie mobile format?

My site is currently in development at http://www.tonynandi.xyz/performance/

Re: Thumbs left not responsive on window size [SOLVED]

As you are aware, the main image scales dynamically with the size of the user's browser window but the thumbnails do not.

Is it possible that if the window is reduced in width that it kicks in the responsive display shown on small screens ie mobile format?

You could perhaps use JavaScript to listen out for a change in the browser's width and display the gallery in Large Screen Mode if the width is greater than a certain threshold value and Small Screen Mode if the width is less than (or equal to) the threshold value. You would also need to use the Juicebox-Pro API. However, this might get a little complex as there would be several things to take into account and you may run into unforeseen problems.

(1) For example, you would need to ensure that the gallery switches Screen Modes only when the threshold is crossed (and not every time the browser window is resized).
(2) Also, if the gallery is displayed in a desktop browser of limited width, Juicebox would ordinarily display the gallery in Large Screen Mode but you would want the gallery to be displayed in Small Screen Mode in this instance.
(3) You would also need to ensure that the gallery is always displayed in Small Screen Mode where Small Screen Mode would normally be used.
(4) The only way to switch screen modes would be to reload the gallery with a different Screen Mode setting and when reloading a gallery, your would need to ensure that the currently displayed image is retained rather than the gallery displaying the first image in the gallery each time the switch is made.

There may be other considerations to take into account which I have not yet thought of.
However, you might like to try the following as a starting point (although please bear in mind that Juicebox was not designed with such functionality in mind).
To see the example in action, create a sample gallery with JuiceboxBuilder-Pro and use the following code as the gallery's 'index.html' page.

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" id="jb-viewport" content="minimal-ui" />
        <style type="text/css">
            body {
                margin: 0px;
            }
        </style>
        <script type="text/javascript" src="jbcore/juicebox.js"></script>
        <script type="text/javascript">

            var fii = 1; // Set initial firstImageIndex to 1
            var sm = 'AUTO'; // Set initial screenMode to AUTO
            var thresholdWidth = 600; // Set thresholdWidth to 600px
            var jb; // Initialize Juicebox object variable for use with Juicebox-Pro API methods

            // Function to load gallery with specified firstImageIndex (to always display current image) and screenMode
            function loadGallery(fii, sm) {
                jb = new juicebox({
                    containerId: "juicebox-container",
                    firstImageIndex: fii,
                    screenMode: sm
                });
            }

            //Function to check width of browser window
            function setScreenMode() {
                var windowWidth = window.innerWidth ? window.innerWidth : $(window).width();
                var mode = windowWidth < thresholdWidth ? 'SMALL' : 'LARGE'; // Determine new screenMode variable
                if (sm !== mode) { // If screenMode variable changes, do the following...
                    sm = mode; // Set screenMode variable to be new screenMode value
                    fii = jb.getImageIndex(); // Set image number to be displayed when gallery is reloaded
                    loadGallery(fii, mode); // Load gallery with specified firstImageIndex and screenMode
                }
            }

            // Do the following when the web page is initially loaded
            $(document).ready(function() {
                $(window).resize(setScreenMode); // Run setScreenMode() function each time the browser window is resized
                loadGallery(fii, sm); // Load gallery with initial firstImageIndex (1) and screenMode (AUTO) settings
                setTimeout(function() { // Timeout required to give enough time for gallery to return actual screenMode used (SMALL or LARGE)
                    sm = jb.getScreenMode(); // Set screenMode variable to be actual screenMode used
                    if (sm === 'LARGE') { // If actual screenMode used is LARGE, do the following...
                        setScreenMode(); // Check width of browser window
                    }
                }, 500);
            });
        </script>
        <title>Test</title>
    </head>
    <body>
        <div id="juicebox-container"></div>
    </body>
</html>

Re: Thumbs left not responsive on window size [SOLVED]

I am using wordpress for the site & putting the code into the header.php file but it didn't work so I added it to the page:
http://www.tonynandi.xyz/journalism/
where is appears to be activating the code as the permalink has #1 / #2 etc depending on which photo is being viewed in the gallery but there is not change in the screen display if I reduce the browser width even if I refresh the screen.

But when I try doing the same change to the page http://www.tonynandi.xyz/performance/ it does not pick up the new code (no #1 appended to the permalink) there is no difference to the pages apart from different xml files, unfortunately performance with the thumbs on the left is the preferred layout.

I had to exclude the first line:<script type="text/javascript" src="jbcore/juicebox.js"></script>
or in my case <script type="text/javascript" src="http://www.tonynandi.xyz/wp-content/uploads/juicebox/journalism/jbcore/juicebox.js"></script>
as this caused an error "Juicebox Error: Config XML file not found."

Sorry I am not a coder, I have spent ages trying different things to get it to work - any idea what have I done wrong?

Re: Thumbs left not responsive on window size [SOLVED]

You currently have two lots of embedding code (the new juicebox() section) on your web page (the code from my example above and your original code) and your original gallery is the one which is initially being loaded into the 'juicebox-container' div on your web page, essentially overriding the gallery from my example. You would need to integrate your own gallery into the rest of the code from my example. Also, your web page currently loads the 'juicebox.js' file after the custom JavaScript code. Try loading the 'juicebox.js' file before the custom JavaScript code.
Try the following in your web page as your complete embedding code:

<script src="/wp-content/uploads/juicebox/journalism/jbcore/juicebox.js"></script>
<script type='text/javascript'> 
    var fii = 1;
    var sm = 'AUTO';
    var thresholdWidth = 600;
    var jb;

    function loadGallery(fii, sm) {
        jb = new juicebox({
            baseUrl : "/wp-content/uploads/juicebox/journalism/",
            containerId : "juicebox-container",
            galleryWidth : "100%",
            galleryHeight : "100%",
            backgroundColor: "#000000",
            firstImageIndex: fii,
            screenMode: sm
        });
    }

    function setScreenMode() {
        var windowWidth = window.innerWidth ? window.innerWidth : $(window).width();
        var mode = windowWidth < thresholdWidth ? 'SMALL' : 'LARGE';
        if (sm !== mode) {
            sm = mode;
            fii = jb.getImageIndex();
            loadGallery(fii, mode);
        }
    }

    $(document).ready(function() {
        $(window).resize(setScreenMode);
        loadGallery(fii, sm);
        setTimeout(function() {
            sm = jb.getScreenMode();
            if (sm === 'LARGE') {
                setScreenMode();
            }
        }, 500);
    });
</script>
<div id="juicebox-container"></div>

Hopefully this will help.

Re: Thumbs left not responsive on window size [SOLVED]

that is fantastic & works perfectly - thanks ever so much for all your help & patience.
Thanks loads :o)

Re: Thumbs left not responsive on window size [SOLVED]

I'm glad that my suggested solution works for you.
Thank you for posting back to let me know.