nowicluk Posted May 10 Share Posted May 10 Hi, I used a code posted by @tuanphan for a website to show captions for photos in the lightbox. Everything worked perfectly fine until I discovered that the text is limited and automatically cut. Does anyone have a solution so all the text is displayed fully? Below is the link to the website and the password. The first photo of the gallery has the example of the caption being cute in the lightbox on desktop and mobile. Appreciate the help. Thank you. https://octahedron-tiger-52rc.squarespace.com/afghanistan-up-close Password: tcl2022 Link to comment
tuanphan Posted May 12 Share Posted May 12 Can you take a screenshot of description input when you enter text in edit mode? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
nowicluk Posted May 12 Author Share Posted May 12 18 hours ago, tuanphan said: Can you take a screenshot of description input when you enter text in edit mode? I tested the first photo of the page with the following text which is cut on desktop and mobile: Link to comment
nowicluk Posted May 15 Author Share Posted May 15 @tuanphan can you help me resolve this issue? I am desperately trying to figure this out so the text is not being cut automatically. I appreciate you support! Link to comment
nowicluk Posted May 20 Author Share Posted May 20 @brandon would you be able to help here? Link to comment
Solution nowicluk Posted May 30 Author Solution Share Posted May 30 Solved myself, below is the code I used from another member: <script> document.addEventListener("DOMContentLoaded", function () { // configure the classes we're looking for const listClass = "div.gallery figure"; const linkClass = "div.gallery-strips-item-wrapper a, div.gallery-grid-item-wrapper a, div.gallery-masonry-item-wrapper a"; const lightBoxCaption = "lightbox-caption"; const lightboxSlideSelector = "div.gallery-lightbox-list figure[data-slide-url='{0}']" // select all gallery elements, find their captions // if they exist then extract the slide id and add a new caption element // to the lightbox slide const n = document.querySelectorAll(listClass); for (var i = 0; i < n.length; i++) { const a = n[i].querySelector(linkClass); const c = n[i].querySelector("figcaption"); if (a && a.href && c) { const id = a.href.split("=")[1]; const lbSelector = lightboxSlideSelector.replace("{0}",id); const lb = document.querySelector(lbSelector); const cp = document.createElement("figcaption"); cp.className = lightBoxCaption; cp.innerHTML = c.innerHTML; lb.appendChild(cp); } } }); </script> <style> figcaption.gallery-caption { display:none; } figcaption.lightbox-caption { bottom:0; font-family: "Europa", serif; font-style: regular; font-size: 16px; line-height: 1.4em; color: #061A37; text-align:justify; } </style> tuanphan 1 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