Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #1605868
opening lightbox gallery
Closed

Comments

  • visocreative started the conversation

    Hi, how can I add the code to open a gallery in lightbox (fancybox) directly from a button?

    I want to open a gallery from a button but only as lightbox

  • [deleted] replied

    Hi,

    Please read documentation: https://fancyapps.com/fancybox/3/docs/. Check "Example of opening image gallery programmatically".

  • visocreative replied

    Hi, thank you but I need to know how to add fancybox code to BUTTON element. There is only a checkbox for "onclick event". Please could you detailed describe me how to select a gallery and open it as fancybox gallery from a button element.

    I want to open a gallery from a single image or button (see attachment please)

    Thanks.

  • [deleted] replied

    Hi,

    Please share admin access. I will try to create example page on your site.

  •   visocreative replied privately
  • [deleted] replied

    Please check.

    Button has class "gallery-button" which used in Raw JS shortcode.

  • visocreative replied

    Thank you Max for your support. I hope I don't fatigue you but by this way I have to add all gallery images manually to the JS code. Could you guide me how to add them as gallery like in the links of the gem gallery: (class="gallery-item-link fancy-gallery" data-fancybox="gallery-5b2b720b85d2d"). Can I call the images from gallery ID?


  • [deleted] replied

    Sorry, by default it's not possible.  It's requires some code changes (it's not a couple lines of code).