<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Juicebox Support Forum — Force thumbnails [SOLVED]]]></title>
		<link>https://juicebox.net/forum/viewtopic.php?id=5234</link>
		<atom:link href="https://juicebox.net/forum/extern.php?action=feed&amp;tid=5234&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Force thumbnails [SOLVED].]]></description>
		<lastBuildDate>Tue, 30 Mar 2021 21:58:45 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Force thumbnails [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17899#p17899</link>
			<description><![CDATA[<p>I&#039;m glad to hear that you&#039;ve settled on the easy solution!<br />Thank you for letting me know. I&#039;ll mark this thread as [SOLVED].</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Juicebox)]]></author>
			<pubDate>Tue, 30 Mar 2021 21:58:45 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17899#p17899</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force thumbnails [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17897#p17897</link>
			<description><![CDATA[<p>All sorted thanks.<br />I disabled the auto play; I wasn’t too keen anyway.</p>]]></description>
			<author><![CDATA[null@example.com (apswoodwork1)]]></author>
			<pubDate>Tue, 30 Mar 2021 18:31:13 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17897#p17897</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force thumbnails [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17895#p17895</link>
			<description><![CDATA[<p>Having seen your gallery, I think the problem is that you set <strong>autoPlayOnLoad=&quot;TRUE&quot;</strong>.<br />In Small Screen Mode, thumbnails and main images are displayed on separate pages and setting <strong>autoPlayOnLoad=&quot;TRUE&quot;</strong> forces Juicebox to skip the initial thumbnail page and start displaying images.<br />You&#039;ll either need to set <strong>autoPlayOnLoad=&quot;FALSE&quot;</strong> or set <strong>screenMode=&quot;LARGE&quot;</strong> (in JuiceboxBuilder-Pro&#039;s &#039;Customize -&gt; General&#039; section) to force the gallery to be displayed in Large Screen Mode on all devices and in all browsers so that you see the desktop layout on your iPhone.</p><p>Unfortunately, there are no separate <strong>autoPlayOnLoad </strong>configuration options for Small vs Large Screen Modes. There is just one <strong>autoPlayOnLoad </strong>configuration option which is shared across both screen modes.</p><p>If you really want to initiate AutoPlay in Large Screen Mode only, then you can do so with help from the <a href="https://www.juicebox.net/support/api/">Juicebox-Pro API</a>.<br />With the API, you can run custom JavaScript as soon as the gallery is loaded (via <strong>onInitComplete</strong>), check which screen mode is being used (via <strong>getScreenMode</strong>) and toggle AutoPlay (via <strong>toggleAutoPlay</strong>).<br />Here&#039;s some sample embedding code which might help:<br /></p><div class="codebox"><pre><code>&lt;script src=&quot;jbcore/juicebox.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
    var jb = new juicebox({
        containerId: &#039;juicebox-container&#039;,
        galleryWidth: &#039;100%&#039;,
        galleryHeight: &#039;100%&#039;,
        backgroundColor: &#039;rgba(34,34,34,1)&#039;
    });
    jb.onInitComplete = function() {
        var screenMode = jb.getScreenMode();
        if (screenMode === &#039;LARGE&#039;) {
            jb.toggleAutoPlay();
        }
    };
&lt;/script&gt;
&lt;div id=&quot;juicebox-container&quot;&gt;&lt;/div&gt;</code></pre></div><p>If you want to initially display thumbnails in Small Screen Mode but want to initiate AutoPlay as soon as a thumbnail is selected, then that is much more complicated. You&#039;ll need to <strong>toggleAutoPlay </strong>when a&nbsp; new image is displayed (via <strong>onImageChange</strong>) but only if it&#039;s the first image to be displayed from a thumbnail page. You&#039;ll need a couple of tracking variables: one to determine whether the image being displayed is the first image to be displayed from a thumbnail page and another to keep track of whether or not AutoPlay is currently on.<br />The following code is not fully tested but it might point you in the right direction:<br /></p><div class="codebox"><pre><code>&lt;script src=&quot;jbcore/juicebox.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
    var autoPlay = false;
    var tracker = false;
    var jb = new juicebox({
        containerId: &#039;juicebox-container&#039;,
        galleryWidth: &#039;100%&#039;,
        galleryHeight: &#039;100%&#039;,
        backgroundColor: &#039;rgba(34,34,34,1)&#039;
    });
    jb.onInitComplete = function() {
        var screenMode = jb.getScreenMode();
        if (screenMode === &#039;LARGE&#039;) {
            jb.toggleAutoPlay();
        }
        if (screenMode === &#039;SMALL&#039;) {
            jb.onImageChange = function(e) {
                if (tracker === false) {
                    jb.toggleAutoPlay();
                    autoPlay = !autoPlay;
                    tracker = true;
                }
            };
            jb.onShowThumbs = function(showing) {
                if (showing) {
                    if (autoPlay) {
                        jb.toggleAutoPlay();
                        autoPlay = !autoPlay;
                    }
                    tracker = false;
                }
            };
        }
    };
&lt;/script&gt;
&lt;div id=&quot;juicebox-container&quot;&gt;&lt;/div&gt;</code></pre></div><p>I hope this helps.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Juicebox)]]></author>
			<pubDate>Tue, 30 Mar 2021 11:22:42 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17895#p17895</guid>
		</item>
		<item>
			<title><![CDATA[Force thumbnails [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17893#p17893</link>
			<description><![CDATA[<p>I have set the following;<br />General- screen size- auto<br />Thumbnails- show thumbs on load- tick<br />Thumbnails- show small thumbs on load- tick</p><p>Still it doesn&#039;t default to thumbnails on an iPhone size breakpoint.<br />What am I doing wrong?<br />I want to force this to happen.</p>]]></description>
			<author><![CDATA[null@example.com (apswoodwork1)]]></author>
			<pubDate>Tue, 30 Mar 2021 09:21:19 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17893#p17893</guid>
		</item>
	</channel>
</rss>
