Topic: Swipe up/down to go back?

First a word about how much I've come to love Juicebox!
It is exactly the tool I was looking for, and I just had the most amazing experience using it. I have an existing page with thumbnails and wanted to launch the gallery view when the user clicks on one of the thumbnails. Since I wanted the gallery to start with the selected image, I browsed through the config options and came across firstImageIndex. Not knowing how I could convey the image index into that variable, I just wrote the links as <a href="gallery.htm#12">, where "12" was the current index. And what can I say? It just worked!? :-)
Maybe this is actually documented somewhere, but I didn't come across it in my quick search. Anyway, that's what I call intuitive!

So, now I managed to have a "< Back" button that also works fine in a browser on my PC. But when I use my gallery on my iPhone (Safari), there is no such button. This, by itself, is not too big a deal, since on devices with touch screens it has become common use to go back from a particular image view by swiping up or down. However, this doesn't work out of the box, and I couldn't find an option that might enable this.
Is there a way to make the swipe up/down gesture go back to the previous page?

Klaus

Re: Swipe up/down to go back?

Oh, and while I'm at it: it would also be nice to have the ESCape key act as "back" button, much like in the facebook image viewer.

Klaus

Re: Swipe up/down to go back?

I'm glad you're getting on well with Juicebox-Pro!

Since I wanted the gallery to start with the selected image, I browsed through the config options and came across firstImageIndex. Not knowing how I could convey the image index into that variable, I just wrote the links as <a href="gallery.htm#12">, where "12" was the current index. And what can I say? It just worked!? :-)

That'll work just fine but it's not actually using the firstImageIndex configuration option. What you are doing (adding #12, for example, to the end of the URL), is essentially using the enableDirectLinks functionality, a short description of which can be found in the General section of the Config Options page). (If you actually set enableDirectLinks="TRUE", then the # number will change in the browser's address bar to reflect the current image being displayed.)

If you wanted to use firstImageIndex, then you could either:
(1) Set a static value for firstImageIndex in your gallery's 'config.xml' file, e.g. firstImageIndex="12".
... or:
(2) Set firstImageIndex in your gallery's embedding code (see here for more information on setting configuration options) either as a static value or a JavaScript variable, e.g.

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

If yourfirstImageIndex value is variable, then you might need to pass the variable to the gallery's web page via a query string in the URL or a session cookie, in which case it would be much easier to continue using the # notation (the enableDirectLinks functionality) that you currently use.

But when I use my gallery on my iPhone (Safari), there is no such button.

You can enable the Back Button in Small Screen Mode (when the gallery is displayed on mobile devices) by setting showSmallBackButton="TRUE" (in JuiceboxBuilder-Pro's 'Customize -> Back Button' section).
However, please note that the Back Button will be displayed only on the main image pages in Small Screen Mode (and not on the Splash Page or the thumbnail pages).
Y
ou could, if you like, force the gallery to be displayed in Large Screen Mode on all devices and in all browsers by setting screenMode="LARGE" (in JuiceboxBuilder-Pro's 'Customize -> General' section) where the Back Button should always be present.

Is there a way to make the swipe up/down gesture go back to the previous page?

Unfortunately, there is no easy way to introduce new swipe gestures within a Juicebox-Pro gallery.
Hopefully setting showSmallBackButton="TRUE" will be a suitable workaround for you, though.

Oh, and while I'm at it: it would also be nice to have the ESCape key act as "back" button, much like in the facebook image viewer.

Facebook opens images in a pop-up window and Esc closes the pop-up.
I'm not exactly sure how this would relate to Juicebox but you should be able to use the Esc key to close an expanded gallery (for example a gallery expanded from a Splash Page or an embedded gallery expanded to fill the browser window or screen) to go back to the gallery's original (unexpanded) state.

If you like, please feel free to post suggestions for future versions in the Feature Requests forum thread.
This keeps all the ideas together and ensures that they are not overlooked by the developers.
I do not know the likelihood of any suggestions being implemented in future versions but this is certainly the best place for all ideas.
Thank you.

Re: Swipe up/down to go back?

I guess I misinterpreted firstImageIndex then. The "#number" feature with enableDirectLinks=FALSE (the default) is exactly what I want, because that way I can get to the gallery by clicking on one of my own thumbnails, navigate through the images in the gallery, and immediately get back to my own page by clicking on the "< Back" button.

Setting showSmallBackButton="TRUE" is a workaround, but having swipe up/down act as "back" function would be preferable.
I'll post that in the Feature Requests thread.

Thanks for your detailed help!

Klaus

Re: Swipe up/down to go back?

You're welcome!
I'm glad my notes were somewhat helpful (and thanks for posting your suggestion in the Feature Requests thread).