KatjaScalia Posted April 30 Posted April 30 (edited) I found this solution that seems to work perfectly on the shared site. But I couldn't adapt the code to make it work on this 7.1 site: https://www.ohoui-munich.com/brautkleider2024/alexandra-grecco @tuanphan can you help, please? Thank you Katja Edited April 30 by KatjaScalia Beyondspace 1
Solution tuanphan Posted May 1 Solution Posted May 1 Use this code to Website > Website Tools > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> jQuery(document).ready(function($){ var texts = document.getElementsByClassName('gallery-caption-content'); $('.gallery-lightbox-list .gallery-lightbox-item').each(function(idx, ele){ var text = texts[idx] var id = $(ele).attr('data-slide-url') if (text) { $(ele).append('<p id="' + id + '" class="light-caption sqsrte-small">' + text.innerHTML + '</p>'); if ($(ele).attr('data-active')) { $(`#${id}`).css('visibility', 'visible') } } }) $('.gallery-masonry-lightbox-link').click(function() { var id = $(this).attr('href').split('=')[1] $('.light-caption').css('visibility', 'hidden') $(`#${id}`).css('visibility', 'visible') }) $('.gallery-lightbox').click(function() { $('.light-caption').css('visibility', 'hidden') var id = location.search.split('=')[1] $(`#${id}`).css('visibility', 'visible') }) }) </script> <style> figcaption.gallery-caption.gallery-caption-grid-masonry { display: none; } .light-caption { visibility: hidden; position: fixed; font: p2; font-family: source code pro; color:grey; font-size: 14px; bottom: 20px; left: 50%; transform: translateX(-50%); margin: 0; } .gallery-lightbox-item[data-active='true'] .light-caption { visibility: visible; } .gallery-lightbox-controls { display: flex !important; } </style> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Beyondspace Posted October 16 Posted October 16 On 4/30/2024 at 3:03 PM, KatjaScalia said: I found this solution that seems to work perfectly on the shared site. But I couldn't adapt the code to make it work on this 7.1 site: https://www.ohoui-munich.com/brautkleider2024/alexandra-grecco @tuanphan can you help, please? Thank you Katja As a side note, the code works for selected layout Gallery section Grid:Simple, check this broader topic by tuanphan to find code for Strips and Masonry layout BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment