Gallery or lightbox gallery in accordion or collapse

2 replies · opened Feb 2, 2022

IistoricuFeb 2, 2022

I can't manage to show a gallery of images when I click on a button whit data collapse and target #collpasExample.
The div that contains the images - div class="masonry-thumbs ..." has a position relative and a height of 0px - only if I try to put it in a collapsed state. If I remove the class collapse the gallery shows great, but I want to be able to show all the images only if I click on a button. I tried with jquery, toggleClass('d-none') but it behaves the same way. The div keeps having the inline style of height:0px. If I put an h tag it shows, only the gallery does not :(. What did I do wrong?

The image is the example of adding the gallery on the toggles-accordion.html and still does not work. Hope I do something wrong and it is an easy fix.

SSemicolon WebSTAFFFeb 2, 2022

Hello,

Consider using the following JS Code at the bottom of the Page after the js/functions.js JS File Linking:
[ch_pre]
jQuery('#collapseTwo').on( 'shown.bs.collapse', function() {
jQuery('.grid-container').isotope('layout');
});
[/ch_pre]

Change this: #collapseTwo with the actual Collapse Content ID.

This should definitely fix the issue. Hope this Helps!

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

IistoricuFeb 2, 2022

Thanx! it Works! :D Closed

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