Topic: How can I do that?

Hello to everybody. My gallery will be divided into some years and each year will have many events with many pictures.

I'd like to use this menu I'm testing to navigate through the gallery

http://test.shift.it/menugallery2/

Question is; how can I integrate this menu (the little green square) in my gallery? I'd like to have it on the left top of the gallery page where normally there's the home icon.

If you've another idea to achieve this result I'll be grateful. Basically I'd like to find a good and responsive way for my users to navigate through the gallery without going back home every time.

Just to have an idea, this is my actual gallery but I'd like to change it with JB to avoid Flash and to have a better navigation system...

http://album.kog.it

Thanks!

Re: How can I do that?

how can I integrate this menu (the little green square) in my gallery?

It would not be possible to actually integrate your menu within a gallery itself but you could display the menu on the same web pages as a gallery, by either overlaying the menu on top of the gallery or by displaying it to the side of the gallery.

Take a look at the Embedding Multiple Galleries support section.
What you are looking to achieve might best be represented by the View Resizable Gallery with Side Menu Example.
You can view the source of the example in your browser and copy/modify the code to suit your own needs (replacing the content of the side menu with your own menu).

An alternative solution (using just a single HTML page) would be to use the following template:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <style type="text/css">
            html, body {
                height: 100%;
                overflow: hidden;
            }
            body {
                margin: 0px;
                background-color: #222222;
            }
            #menu {
                background-color: #222222;
                color: #666666;
                font-family: sans-serif;
                font-size: 20px;
                float: left;
                padding: 20px 0px 0px 10px;
                text-align: center;
                height: 100%;
                width: 100px;
            }
            #menu a {
                color: #666666;
                text-decoration: none;
            }
            #wrap {
                float: right;
                height: 100%;
            }
        </style>
        <script type="text/javascript" src="gallery1/jbcore/juicebox.js"></script>
        <script type="text/javascript">
            function doLayout() {
                var windowHeight = window.innerHeight ? window.innerHeight : $(window).height();
                var windowWidth = window.innerWidth ? window.innerWidth : $(window).width();
                var menuWidth = $('#menu').outerWidth();
                var galleryHeight = parseInt(windowHeight);
                var galleryWidth = parseInt(windowWidth) - parseInt(menuWidth);
                $('#wrap').height(galleryHeight);
                $('#wrap').width(galleryWidth);    
            }
            function loadGallery(base) {
                new juicebox({
                    baseUrl: base,
                    containerId: 'juicebox-container'
                });
            }
            $(document).ready(function () {
                doLayout();
                $(window).on('resize', doLayout);
                loadGallery('gallery1/');
            });
        </script>
        <title>Test</title>
    </head>
    <body>
        <div id="menu">
            <a href="#" onclick="javascript: loadGallery('gallery1/'); return false;">Gallery 1</a>
            <br />
            <a href="#" onclick="javascript: loadGallery('gallery2/'); return false;">Gallery 2</a>
        </div>
        <div id="wrap">
            <div id="juicebox-container"></div>
        </div>
    </body>
</html>

To see how this works, create a couple of test galleries and name the gallery folders 'gallery1' and 'gallery2'.
Next, create an HTML file with the code above and put the file in the same directory as the 'gallery1' and 'gallery2' folders and open the HTML file in a browser.

All you would need to do to customize this to your own requirements would be to replace the content of the 'menu' div with your own menu.
You can create as many galleries as you like and name the folders whatever you like. Just keep each gallery in its own folder keep all the folders in the same directory, alongside the HTML file. The links to each gallery from within your menu would look something like the links in the code above (using the loadGallery function to load the selected gallery using the baseUrl method).

Re: How can I do that?

Thanks for the reply. I'll test this asap...

4 (edited by andrea.marucci 2013-11-13 10:55:19)

Re: How can I do that?

Tested but my knowledge of CSS is too limited to make it work. I've to find a responsive solution to let the users navigate through my galleries without going back home every time...

Re: How can I do that?

Steven do you think that something like that can be easily implemented? That solution would be perfect since doesn't steal real estate to the gallery and let you define a menu to navigate through your galleries. For example the menu can be triggered clicking on the home icon :-)

http://tympanus.net/Development/MultiLe … ndex2.html

Re: How can I do that?

This may be possible but might be difficult to implement cleanly (especially across different devices).
Try this as an example:

(1) Download the Multi-Level Push Menu zip file from this web page.
(2) Extract the zip file to your hard drive.
(3) Create two sample galleries with JuiceboxBuidler-Pro and name the gallery folders 'gallery1' and 'gallery2'.
(4) Place the complete gallery folders into the 'MultiLevelPushGallery' folder (from the extracted zip file).
(5) Create a new HTML file named 'main.html' using the code below.
(4) Place the 'main.html' file in the 'MultiLevelPushGallery' folder (alongside the gallery folders).
(5) Open the 'main.html' file in a browser and click the Back Button to see the menu system in action.
There are some problems with this which would need to be ironed out (such as the need to click the Back Button twice after selecting a new gallery to close the menu) but I hope it points you in the right direction.

<!DOCTYPE html>
<html lang="en" class="no-js">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <title>Multi-Level Push Menu - Demo 1</title>
        <meta name="description" content="Multi-Level Push Menu: Off-screen navigation with multiple levels" />
        <meta name="keywords" content="multi-level, menu, navigation, off-canvas, off-screen, mobile, levels, nested, transform" />
        <meta name="author" content="Codrops" />
        <link rel="shortcut icon" href="../favicon.ico">
        <link rel="stylesheet" type="text/css" href="css/normalize.css" />
        <link rel="stylesheet" type="text/css" href="css/demo.css" />
        <link rel="stylesheet" type="text/css" href="css/icons.css" />
        <link rel="stylesheet" type="text/css" href="css/component.css" />
        <script src="js/modernizr.custom.js"></script>
        <script src="js/classie.js"></script>
        <script src="js/mlpushmenu.js"></script>
    </head>
    <body>
        <div class="container">
            <!-- Push Wrapper -->
            <div class="mp-pusher" id="mp-pusher">
                <!-- mp-menu -->
                <nav id="mp-menu" class="mp-menu">
                    <div class="mp-level">
                        <h2 class="icon icon-world">Galleries</h2>
                        <ul>
                            <li><a href="#" onclick="javascript: loadGallery('gallery1/'); return false;">Gallery 1</a></li>
                            <li><a href="#" onclick="javascript: loadGallery('gallery2/'); return false;">Gallery 2</a></li>
                        </ul>
                    </div>
                </nav>
                <!-- /mp-menu -->
                <div class="scroller"><!-- this is for emulating position fixed of the nav -->
                    <div class="scroller-inner">
                        <script src="gallery1/jbcore/juicebox.js"></script>
                        <script>
                            function loadGallery(base) {
                                jb = new juicebox({
                                    baseUrl: base,
                                    backButtonPosition: 'TOP',
                                    backButtonUrl: '#',
                                    backButtonUseIcon: 'TRUE',
                                    containerId: 'juicebox-container'
                                });
                                jb.onInitComplete = function() {
                                    var backElements = document.getElementsByClassName('jb-go-back-icon');
                                    var backButton = backElements[0];
                                    new mlPushMenu(document.getElementById('mp-menu'), backButton);
                                };
                            }
                            $(document).ready(function () {
                                loadGallery('gallery1/');
                            });
                        </script>
                        <div id="juicebox-container"></div>
                    </div><!-- /scroller-inner -->
                </div><!-- /scroller -->
            </div><!-- /pusher -->
        </div><!-- /container -->
    </body>
</html>

Re: How can I do that?

Thanks. Unfortunately I've noticed that if you put many menu items there isn't any scrolling possibility so that the users with smaller screen miss all the menu option under the bottom line of the screen.

I've switched to this one

http://tympanus.net/codrops/2013/04/19/ … evel-menu/

I'll try to follow your instruction to embed this in my galleries...

Re: How can I do that?

It should hopefully be relatively easy to implement the Responsive Multi-Level Menu by using the template in my first post above, loading the required Responsive Multi-Level Menu external CSS and JavaScript source files in the <head> section of the page, replacing the contents of the 'menu' <div> with the required Responsive Multi-Level Menu entries and adding the snippet of JavaScript code (from the Responsive Multi-Level Menu sample HTML files) before the closing </body> tag.
You can also reduce the width of the 'menu' <div> so that the Responsive Multi-Level Menu icon does not take up too much screen real estate.