Jump to content

Iknowkungfu

Member
  • Posts

    5
  • Joined

  • Last visited

Iknowkungfu's Achievements

Level 1

Level 1 (1/20)

0

Reputation

  1. Hope someone can help, I found the code at the very bottom to use to style lightbox captions and it looks cool but now the captions don't show on the grid - I know its down to this or at least I think I do. Can anyone help me out, I'm not a dev, I just know enough to be dangerous! <style> figcaption.gallery-caption.gallery-caption-grid-simple { display: none; Thanks KF <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> function createNodeCaption(textContent){ var divElement = document.createElement("div"); var pElement = document.createElement("p"); pElement.innerHTML = textContent; divElement.classList.add("style-gallery-lightbox-text"); divElement.appendChild(pElement); return divElement; } $( document ).ready(function() { var itemGallery = document.getElementsByClassName('gallery-grid-item'); var itemGalleryLightBox = document.getElementsByClassName('gallery-lightbox-item'); var countGalleryItem = itemGallery.length; for(var i = 0; i < countGalleryItem; i++){ if(itemGallery[i].getElementsByTagName('p').length != 0){ var text = itemGallery[i].getElementsByTagName('p')[0].textContent; var itemNeedCaption = itemGalleryLightBox[i].getElementsByClassName('gallery-lightbox-item-src')[0]; itemNeedCaption.appendChild(createNodeCaption(text)); } } }); </script> <style> figcaption.gallery-caption.gallery-caption-grid-simple { display: none; } .style-gallery-lightbox-text { padding: 10px 0px 25px 0px; display: block; position: absolute; left: 50%; top: 90%; width: 100%; transform: translate(-50%, -50%); font-size: .3em text-align: left; } .style-gallery-lightbox-text p { width: 90%; padding: 10px 15px; margin: auto; color: white; background-color: rgba(0,0,0,0.5); } @media screen and (max-width:767px) { .style-gallery-lightbox-text { top: 70%; } } </style>
  2. Hi there if you are still on this forum, this looks really helpful, one question does this create more than 1 H1 tag and if it does is there a way to comment out the original H1 or does it not matter because it will be blank?
  3. Hi all, anyone know how I can pass donation values from a stripe page to the datalayer so I can record it in GA4? I can't see anything on the confirmation page that gives me the key value that I need? Thanks IKKF
  4. Site isn't published yet, just trying to help out a charity. Is there a way to make the drop down neater so the width of the background fits the text better
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.