Kris-B / nanoGALLERY

image gallery simplified - jQuery plugin. Touch enabled, responsive, justified/cascading/grid layout and it supports pulling in Flickr, Google Photos and self hosted images.
https://nanogallery2.nanostudio.org/
439 stars 101 forks source link

closing slideshow after openOnStart #73

Closed jstranger closed 9 years ago

jstranger commented 9 years ago

I have been working with openOnStart as I need a simple link from with a web page to open and run a slideshow without any need for thumbnails. This now works (at least when I specify albumID and imageID), but after closing the slideshow (using either the X top R of viewer or in the toolbar) the link no longer works.

HTML is as follows:

<a id="startlink" href="javascript:void(0)" style="margin-bottom: 40px;">run slide show</a>
<div id="gallery">
        <a href=... data-ngalbumid="artist" data-ngid="1" data-ngdesc=..

Script is as follows:

    $(document).ready(function () {
        $("#startlink").click(function (e) {
            $("#gallery").nanoGallery({
                openOnStart: "artist/1",
                slideshowAutoStart: true,
                colorSchemeViewer: "dark",
                viewerToolbar: {standard: "previousButton, pageCounter, nextButton, playPauseButton, label"},
            });
        });
    });
Kris-B commented 9 years ago

Please use the API method displayItem instead of the option openOnStart.