Viewing 2 replies - 1 through 2 (of 2 total)
  • Sure! FancyBox works on links and it does not matter where it links from. It can be simple text, a thumbnail image or a button image. Like the button “see how it works” but then link it to a full size image.

    To make that first image (that opens after clicking the button image) be part of a gallery of images in FancyBox, you will need to include links to all the other images that you want to see in that gallery on that same page. These links do not have to be visible on normal view. They just need to be present in the source.

    You can add invisible links to images by using link code without any anchor text or thumbnail image in it. And if you’re not using the auto-detect and/or auto-gallery options on Settings > Media, then make sure to include matching class and rel attributes.

    Like for example:

    <a href="https://the.url.of/your/image1.jpg" class="fancybox" rel="gallery-1"><img src="https://the.url.of/your/button.png" alt="open gallery" /></a>
    <a href="https://the.url.of/your/image2.jpg" class="fancybox" rel="gallery-1"></a>
    <a href="https://the.url.of/your/image3.jpg" class="fancybox" rel="gallery-1"></a>

    Hope that helps ??

    Thank you! This works for me. After days of searching Your solution solution helped me out a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Open lightbox from a button’ is closed to new replies.