Jump to content

How can I make clicking on my logo open my navigation menu?

Go to solution Solved by creedon,

Recommended Posts

roseandcodesign.ca

Here is the code I've added to my custom css section:

/*adds logo over homepage slideshow*/
#collection-66abca86f4a970287d00bdb6:before {
    content: "";
    background-image: url(https://images.squarespace-cdn.com/content/6320953b85446233a75238cd/b46a4d10-2b29-4176-81df-7b605f7d6917/Asset+2.png?content-type=image%2Fpng);
background-repeat: no-repeat;
    background-size: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    z-index: 9999;
    width: 100px;
    height: 100px;
}

How can I make it so that clicking on my logo has the same result as clicking on the hamburger icon? 

Link to comment
1 hour ago, sb9201 said:

roseandcodesign.ca

Here is the code I've added to my custom css section:

/*adds logo over homepage slideshow*/
#collection-66abca86f4a970287d00bdb6:before {
    content: "";
    background-image: url(https://images.squarespace-cdn.com/content/6320953b85446233a75238cd/b46a4d10-2b29-4176-81df-7b605f7d6917/Asset+2.png?content-type=image%2Fpng);
background-repeat: no-repeat;
    background-size: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    z-index: 9999;
    width: 100px;
    height: 100px;
}

How can I make it so that clicking on my logo has the same result as clicking on the hamburger icon? 

I think we need to implement js code to handle the action clicking your custom logo?  Or may be another forum member can share other interesting ideas

Press 👍  or mark my comment as solution if you find my sharing useful

🆒 Squarespace pinchzoom lightbox plugin (affiliate link)

👁‍🗨 360 degree photo viewer (affiliate link)

Link to comment
1 minute ago, HoaLT said:

I think we need to implement js code to handle the action clicking your custom logo?  Or may be another forum member can share other interesting ideas

I'm really not sure. Hopefully someone is able to help! 

Link to comment
  • Solution

This is not a full solution but it should take care of the click part of the issue.

Add the following to Page Settings > Advanced > Page Header Code Injection for the home page. Please see per-page code injection.

<script>

  /*
  
    Version     : 0.1.0
    
    SS Version  : 7.1
    
    v7.1
    Fluid
    Engine
    Compatible  : Yes
    
    Copyright   : 2024 Thomas Creedon
                  
                  Tom's Web Consulting < http://www.tomsWeb.consulting/ >
    
    */
    
  const callback = ( ) => {
  
    const callback = ( ) => {
    
      const selector = '.burger';
      
      document
      
        .querySelector ( selector )
        
        .click ( );
    
      };
      
    const selector = '#page';
    
    document
    
      .querySelector ( selector )
      
      .addEventListener ( 'click', callback );
      
    };
    
  addEventListener ( 'DOMContentLoaded', callback );
   
  </script>

Also a minor change to the CSS.

.homepage #page::before {

  background-image : url( https://images.squarespace-cdn.com/content/6320953b85446233a75238cd/b46a4d10-2b29-4176-81df-7b605f7d6917/Asset+2.png );
  background-repeat : no-repeat;
  background-size : contain;
  content : '';
  cursor : pointer;
  height : 100px;
  left : 50%;
  position : fixed;
  top : 50%;
  transform : translate( -50%, -50% );
  width : 100px;
  z-index : 99;
  
  }

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
On 8/2/2024 at 7:16 PM, creedon said:

This is not a full solution but it should take care of the click part of the issue.

Add the following to Page Settings > Advanced > Page Header Code Injection for the home page. Please see per-page code injection.

<script>

  /*
  
    Version     : 0.1.0
    
    SS Version  : 7.1
    
    v7.1
    Fluid
    Engine
    Compatible  : Yes
    
    Copyright   : 2024 Thomas Creedon
                  
                  Tom's Web Consulting < http://www.tomsWeb.consulting/ >
    
    */
    
  const callback = ( ) => {
  
    const callback = ( ) => {
    
      const selector = '.burger';
      
      document
      
        .querySelector ( selector )
        
        .click ( );
    
      };
      
    const selector = '#page';
    
    document
    
      .querySelector ( selector )
      
      .addEventListener ( 'click', callback );
      
    };
    
  addEventListener ( 'DOMContentLoaded', callback );
   
  </script>

Also a minor change to the CSS.

.homepage #page::before {

  background-image : url( https://images.squarespace-cdn.com/content/6320953b85446233a75238cd/b46a4d10-2b29-4176-81df-7b605f7d6917/Asset+2.png );
  background-repeat : no-repeat;
  background-size : contain;
  content : '';
  cursor : pointer;
  height : 100px;
  left : 50%;
  position : fixed;
  top : 50%;
  transform : translate( -50%, -50% );
  width : 100px;
  z-index : 99;
  
  }

Let us know how it goes.

It worked!!!!!! THANK YOU so much. Do you know how to fix my last menu issue by any chance? https://forum.squarespace.com/topic/318055-how-can-i-add-my-site-footer-to-my-mobile-menu/

 

Also, do you have somewhere I can send you a tip as a thank you like buymeacoffee or paypal? 

 

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.