Lightbox Gallery in Modal

2 replies · opened Feb 22, 2017

DdaihloFeb 22, 2017

I am loading a five-column gallery in a modal - it's all good other than the lightbox functionality when the images are clicked - the link brings the browser to the image itself rather than opening a lightbox to browse the gallery.
I have tried to add a lightbox initialisation in the modal html, but without success:

<script>
function() {
SEMICOLON.initialize.lightbox();
});
</script>

Can you advise?

Edit: Live URL: http://jewelnet.ltd/eq/ -> second image (rings) opens the modal in question.

SSemicolon WebSTAFFFeb 22, 2017

Hello,

Unfortunately, this is not supported by the Lightbox Plugin since the First Modal and the Gallery Lightbox are the Same Plugins and the Second Instance of the Plugin cannot be loaded into the First Instance.

Consider using the Bootstrap Modal: http://themes.semicolonweb.com/html/canvas/modal-popovers.php to show the Thumbs so that the Magnific Lightbox can be used for the Gallery.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

DdaihloFeb 23, 2017

Hey thanks for the advice :)

I have setup the bootstrap modal to display the gallery, but it has produced other problems :D

You can see it yourself at http://jewelnet.ltd/eq/news.php

  1. The modal container does not contain the gallery.
  2. The gallery is not initialised on modal load, but does appear when you resize the page.
  3. Clicking a gallery thumb does produce a lightbox, but the lightbox is underneath the modal (z-index)
  4. Clicking in the lightbox area for the next image in the gallery closes the modal, but leaves the lightbox.

I am thinking that galleries in modals are not the way forward!

Whilst doing this I realised that I don't need a gallery modal popover, I just need the gallery lightbox to open when the 'rings' button is clicked (see first post). Is it possible to have a gallery lightbox without showing the gallery? Is lazy loading also an option with this?

Am interested in your thoughts.
Thanks :)

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard