M_Fancy_Sites Posted January 12, 2023 Share Posted January 12, 2023 Hi all, I'm wondering if there's a way to code for showing file names (not captions) when photos are opened in a lightbox from a grid gallery. My client has hundreds of family photos, all named appropriately (i.e., Andy_1962.jpg) and they want the file name to show when opened in the lightbox, but not on the grid. I tried the below code, but it didn't work. Any insight? Header injection: <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK" crossorigin="anonymous"></script> <script> window.Squarespace.onInitialize(Y, function(){ $('.slide img').each(function(i) { $('.image-slide-title').eq(i).html('' + $(this).attr('alt').replace('.jpg', '') + ''); }); }); </script> CSS: .sqs-gallery-block-grid.sqs-gallery-block-meta-only-title .margin-wrapper .image-slide-title { line-height: 1.2em; white-space: pre-wrap; overflow: visible; } Thanks! Mary Alice Link to comment
tuanphan Posted January 15, 2023 Share Posted January 15, 2023 What is your site url? We can check easier 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!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment