Jump to content

AThompson_social

Member
  • Posts

    19
  • Joined

  • Last visited

Posts posted by AThompson_social

  1. @tuanphan So I can't get it to trigger a color change. the Page is an index so do I need to put the script in the header of each individual page in the index or just in the header of the index? i've tried both and I can't get it to work. In addition, even when using the script, I can't get the nav to be sticky to the top of the window.  I have the nav sticky using the first set of css

     

    script in the header 

    <script>
    // When the user scrolls down 50px from the top of the document, resize the header's font size
    window.onscroll = function() {scrollFunction()};
    
    function scrollFunction() {
      if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
        document.getElementById("header").style.color = "#6ed78f";
      } else {
        document.getElementById("header").style.color = "#173d56";
      }
    }
    </script>

    css for making the nav stick to the top of the page 

    /*sticky nav https://forum.squarespace.com/topic/142732-brinekeene-sticky-navigation/#comment-184292*/
    Header {
       position: fixed !important;
       top: 0 !important;
       left: 0 !important;
       right: 0 !important;
    }
    
       // fix mobile nav
       .Mobile-bar--top
        {
         position: fixed;
           top: 0;
           left: 0;
           right: 0;
           background: #173d56;
       }
       .Mobile-bar {
           position: fixed;
           z-index: 99999;
       }
    
       // move mobile overlay down
       .Mobile-overlay-menu-main {
           padding-top: 80px;
       }

    css for the transition color change

    header{
       transition: 0.2s;
      color: #173d56;
    }

     

  2. Hi friends, 

    I am trying to trigger my navigation to change color after scrolling past the hero. Is there a way I can trigger the change by div or pixel? I currently have my nav as a sticky nav and want to keep that. this is what I'm working with. 

     

    /*sticky nav https://forum.squarespace.com/topic/142732-brinekeene-sticky-navigation/#comment-184292*/
    Header {
       position: fixed !important;
       top: 0 !important;
       left: 0 !important;
       right: 0 !important;
    }
    
       // fix mobile nav
       .Mobile-bar--top
        {
         position: fixed;
           top: 0;
           left: 0;
           right: 0;
           background: #173d56;
       }
       .Mobile-bar {
           position: fixed;
           z-index: 99999;
       }
    
       // move mobile overlay down
       .Mobile-overlay-menu-main {
           padding-top: 80px;
       }

    any help would be GREATLY APPRECIATED 

    link to site

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