Jump to content

(JULIA) How do I view one Gallery Block at a Time (without seeing others beneath it)?

Recommended Posts

  • ryanmariehelfant changed the title to (JULIA) How do I view one Gallery Block at a Time (without seeing others beneath it)?
  • Replies 16
  • Views 712
  • Created
  • Last Reply

You could use this snippet by pasting it into 

Settings->Advanced->Custom Code Injection

<script>
  window.onhashchange = function() {
      [].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
        div.style.display = "none";
      });
      var hash = location.hash;
      if (hash) {
          hash = hash.replace("#", "");
        
         var proj = document.querySelector("#projectThumbs .project[href='"+hash+"']");
        	
        if (proj) {
        	 proj.style.display = "block";
        }        
      } else {
      	[].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
          div.style.display = "block";
        });
      }
  };
</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

image.thumb.png.dd3dc71d6eb983643a495c0840095d73.png

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
Just now, ryanmariehelfant said:

Thank you @bangank36 is there also a way to get rid of the gallery thumbnail beneath the gallery video? 

<script>
  window.onhashchange = function() {
      [].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
        div.style.display = "block";
      });
      var hash = location.hash;
      if (hash) {
          hash = hash.replace("#", "");
        
         var proj = document.querySelector("#projectThumbs .project[href='"+hash+"']");
        	
        if (proj) {
        	 [].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
                div.style.display = "none";
              });
        }        
      }
  };
</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

Thank you @bangank36

 

Finally question!

 

Is there also a way to get rid of the Footer Content beneath the Gallery Block (the contacts at the bottom center of my page with the names & email addresses) when I click on a Gallery Block?

 

I would like to keep the contacts on my main page, but when I go to individual gallery blocks, I would not like that contact information to appear.

 

Thank you so so much!

 

 

Link to comment
<script>
  window.onhashchange = function() {
      [].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
        div.style.display = "block";
      });
     document.querySelector("#footer").style.display = "block";
      var hash = location.hash;
      if (hash) {
          hash = hash.replace("#", "");
        
         var proj = document.querySelector("#projectThumbs .project[href='"+hash+"']");
        	
        if (proj) {
        	 [].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
                div.style.display = "none";
              });
          	 document.querySelector("#footer").style.display = "none";
        }        
      }
  };
</script>

Cheers

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
2 minutes ago, ryanmariehelfant said:

@bangank36 Thank you!!!

Thank you, please choose the correct answers so other people can know when they face the same issue

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
3 minutes ago, ryanmariehelfant said:

@bangank36 When I refresh the page, it goes back to the old format (with thumbnails and contact info beneath the video). Is there Custom CSS to avoid this from happening when I refresh the page?

Interesting, I will update the code

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

Make sure to change the script location on footer custom injection

<script>

  function checkProjectsHash() {

    [].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
        div.style.display = "block";
      });
     document.querySelector("#footer").style.display = "block";
      var hash = location.hash;
      if (hash) {
          hash = hash.replace("#", "");
        
         var proj = document.querySelector("#projectThumbs .project[href='"+hash+"']");
          
        if (proj) {
           [].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
                div.style.display = "none";
              });
             document.querySelector("#footer").style.display = "none";
        }        
      }

  }

  checkProjectsHash();
  
  window.onhashchange = function() {
    checkProjectsHash();
  };
</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
2 hours ago, ryanmariehelfant said:

 

@bangank36 Is there a way to hide the Title & Subtitle when I click on a  Gallery Block? (So nothing is above the video, but the spacing between the top of the video and top of the website is maintained)?

 

Cheers!

Seems like you resolve it 

image.thumb.png.608b221a63ef6f96ac0090fc418736cc.png

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
<script>

  function checkProjectsHash() {

    [].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
        div.style.display = "block";
      });
     document.querySelector("#footer").style.display = "block";
     document.querySelector("#header").style.visibility = "visible";
      var hash = location.hash;
      if (hash) {
          hash = hash.replace("#", "");
        
         var proj = document.querySelector("#projectThumbs .project[href='"+hash+"']");
          
        if (proj) {
           [].forEach.call(document.querySelectorAll("#projectThumbs .project"), function(div) {
                div.style.display = "none";
              });
             document.querySelector("#footer").style.display = "none";
          	document.querySelector("#header").style.visibility = "hidden";
        }        
      }

  }

  checkProjectsHash();
  
  window.onhashchange = function() {
    checkProjectsHash();
  };
</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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.