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)?

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>

 

Edited by bangank36

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, 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

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, 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>

 

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, 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

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, 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

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, 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

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, 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>

 

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, 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

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, 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>

 

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

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