Jump to content

nowicluk

Circle Member
  • Posts

    70
  • Joined

  • Last visited

Community Answers

  1. nowicluk's post in Coded caption under photo in lightbox is being cut was marked as the answer   
    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>
  2. nowicluk's post in Gallery carousel to rotate 3 images at a time was marked as the answer   
    I have fixed it myself. Thank you anyways.
  3. nowicluk's post in Photo description displayed in lightbox under photo in photo gallery section was marked as the answer   
    Thank you. I coded it myself.
  4. nowicluk's post in How to change social media icons in navigation? was marked as the answer   
    Closed.
  5. nowicluk's post in Mobile navigation menu displayed in two lines and doesn't allow me to align it was marked as the answer   
    I figured it all out. Thank you.
  6. nowicluk's post in Preset photo carousel does not display properly on mobile was marked as the answer   
    I figured it all out. Thank you.
     
×
×
  • 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.