Hi all,
I’ve been trying to add a photo gallery to my site using the custom liquid and some coding I’ve found online. Currently, the photos are in a square, 3 column grid which I would like to keep. I’ve managed to make the images clickable so that they can be opening to full size, but it opens them on a new page instead of opening them on the same page. I’d love to be able to have them open on the same page and include an “x” button to return to the full gallery.
Here is the custom code I currently have. Thank you in advance!!!
Photo Gallery .gallery { display: grid; grid-template-columns: repeat(3, calc(35% - 40px)); grid-gap: 20px; margin-top: 0px; /* Top margin */ margin-right: 40px; /* Right margin */ margin-left: 40px; /* Left margin */ margin-bottom: 60px; /* Bottom margin */ } .gallery img { width: 100%; height: auto; object-fit: cover; aspect-ratio: 1; /* This ensures the images are squares */ cursor: pointer; /* Add cursor pointer to indicate the image is clickable */ }/* Close button style */
#lightboxClose {
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
color: #fff;
font-size: 24px;
z-index: 9999;
}
