Question

I'm using Lightbox2 with print (http://sandbox.tse-webdesign.be/lightbox-print/). I'd like to give the user the option within the lightbox effect to go back to the beginning on the slideshow. Has anyone implemented anything like this?

Less ideal but perhaps easier if a button/link to go to the beginning of the slideshow is difficult - can I just wrap the show? So when the user gets to image 10 or 10, clicking the next button will go to image 1 of 10?

Was it helpful?

Solution

Added a new modal in the JS file. Last image in slideshow would point back to the very first image of the gallery.

      //Go back home
  $lightbox.find('.lb-backhome').on('click', function(e) {
    _this.changeImage(0);
    console.log('back home link');
    return false;
  });    

And

      if (this.currentImageIndex < this.album.length - 1) {
    $lightbox.find('.lb-next').show();
  }else{
    //Return this click index back to number one image
    $lightbox.find('.lb-backhome').show();
  }

Just update the entire my revised CSS and JS file and you'll be good to go.

My fiddle here: http://jsfiddle.net/eguky/

Per CC rules

Lightbox v2.51 by Lokesh Dhakar - http://www.lokeshdhakar.com

For more information, visit: http://lokeshdhakar.com/projects/lightbox2/

Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/ - free for use in both personal and commercial projects - attribution requires leaving author name, author link, and the license info intact

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top