F-RAVN Posted October 28, 2020 Share Posted October 28, 2020 I need to add descriptions to a gallery carousel without having it visible on the main gallery. Is there any way to tweak the code to exclude descriptions on the main gallery? So far, I've only found additional code which adds a description in both places: <script> /** * Add descriptions/captions to galleries in Squarespace 7.1. * JavaScript * © @brandon (Squarespace Forum User) * This software is provided "as is", without warranty of any kind, express or implied. */ document.addEventListener("DOMContentLoaded", function() { addGalleryItemDescriptions(); function addGalleryItemDescriptions(gs, gdzs) { var a=['querySelectorAll','section.gallery-section,\x20.gallery-lightbox','length','[class*=\x27-item\x27]:not([class*=\x27item-\x27])','getElementsByTagName','img','alt','trim','createElement','div','className','gallery-item-description','textContent','appendChild'];var b=function(c,d){c=c-0x0;var e=a[c];return e;};(function(c,d){var e,f,g,h,i,j,k;e=document[b('0x0')](c?c:b('0x1'));i=e[b('0x2')];while(i--){f=e[i][b('0x0')](d?d:b('0x3'));j=f[b('0x2')];while(j--){g=f[j][b('0x4')](b('0x5'))[0x0][b('0x6')][b('0x7')]();if(g){h=document[b('0x8')](b('0x9'));h[b('0xa')]=b('0xb');h[b('0xc')]=g;f[j][b('0xd')](h);}}}}(gs,gdzs)); } }); </script> Link to comment
Beyondspace Posted October 28, 2020 Share Posted October 28, 2020 I made a slightly changes, please check if it work <script> /** * Add descriptions/captions to galleries in Squarespace 7.1. * JavaScript * © @brandon (Squarespace Forum User) * This software is provided "as is", without warranty of any kind, express or implied. */ document.addEventListener("DOMContentLoaded", function() { addGalleryItemDescriptions(); function addGalleryItemDescriptions(gs, gdzs) { var a=['querySelectorAll','section.gallery-section-exclude,\x20.gallery-lightbox','length','[class*=\x27-item\x27]:not([class*=\x27item-\x27])','getElementsByTagName','img','alt','trim','createElement','div','className','gallery-item-description','textContent','appendChild'];var b=function(c,d){c=c-0x0;var e=a[c];return e;};(function(c,d){var e,f,g,h,i,j,k;e=document[b('0x0')](c?c:b('0x1'));i=e[b('0x2')];while(i--){f=e[i][b('0x0')](d?d:b('0x3'));j=f[b('0x2')];while(j--){g=f[j][b('0x4')](b('0x5'))[0x0][b('0x6')][b('0x7')]();if(g){h=document[b('0x8')](b('0x9'));h[b('0xa')]=b('0xb');h[b('0xc')]=g;f[j][b('0xd')](h);}}}}(gs,gdzs)); } }); </script> BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
F-RAVN Posted October 29, 2020 Author Share Posted October 29, 2020 Amazing, it works! Thank you!! 🙏 Now the only slight issue is the 'echo' when flipping through the carousel. I've attached a screen recording. Any chance you know how to fix that? Screen Recording – description echo.mov Link to comment
inunzi Posted October 29, 2020 Share Posted October 29, 2020 13 hours ago, F-RAVN said: Amazing, it works! Thank you!! 🙏 Now the only slight issue is the 'echo' when flipping through the carousel. I've attached a screen recording. Any chance you know how to fix that? Screen Recording – description echo.mov I’m not to sure since I’m not a pro at coding, but I would check the codes if I were you, to see if there’s something messing up with the transition. Link to comment
ibisette Posted November 3, 2020 Share Posted November 3, 2020 Hi I really am desperate for help on this issue. On pc the website looks fabulous, exactly the way I wanted it to be. Problem comes up on mobile. www.ibisette.com/portfolio/portraits for example, all portrait-oriended photo's in the carousel show a lot of blank space on both left and right side of the image as you can see on the screenshot below. I would like to have the carousel to be taller so that pictures in both landscape and portrait mode be seen clearly. (I have absolutely no problem with how the landscape mode pictures are displayed now, it's great. It's just for the portrait mode that the blank space is way too big. I would love it to look a little more like the paint job I did below: Is there anyone who could help me write a little bit of code to fix this issue? I have disabled the autoplay. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.