[Resolved] Sticky second navigation

Home Forums Support [Resolved] Sticky second navigation

Home Forums Support Sticky second navigation

Viewing 7 posts - 31 through 37 (of 37 total)
  • Author
    Posts
  • #1638511
    nik9

    Yes! no error and id works!

    Thanks πŸ™‚

    #1641151
    Elvin
    Staff
    Customer Support

    Nice one. No problem. πŸ™‚

    #2104411
    Torsten

    Hey there,

    That menu – using the script from Elvin – looks very nice!
    However, would it be possible to also move the secondary nav back to the very top or better let it stay and stick there?

    Cheers,
    Torsten

    #2104608
    Elvin
    Staff
    Customer Support

    Hi Torsten,

    This part of the script was meant to stick the secondary back to the top if the scroll is on the top of the page.

    if(window.scrollY==0){ 
    			 	console.log("Top of page");
    				secondaryNav.style.position = "relative";
    				secondaryNav.style.top = "0px";
    				secondaryNav.classList.remove('fadein');
    			}

    The rest is basically making it behave similar to how the theme makes the header sticky.

    This script specifically just calculates the secondary nav’s height and uses that value to push the sticky header down so the secondary nav has space on top of the sticky header.

    Perhaps I’m misunderstanding what you meant to ask here. Can you explain a bit more? Perhaps link us to a demo site w/ the same functionality you meant to have?

    #2106135
    Torsten

    .

    #2106142
    Torsten

    Hi Elvin,

    Thanks for your quick reply πŸ™‚

    I would like to have the secondary nav going back to the top also when scrolling down (not going underneath the primary nav) so it should be always on top after the initial load of the page, scrolling down the page down, and scrolling up again.

    I like that neat delayed fade effect of the primary nav when scrolling.

    I tried with CSS:

    #sticky-navigation { top: 42px !important;}
    .main-navigation { margin-top: 42px; } 

    but that leaves a gap underneath the secondary nav when loading the page initially so I think it needs to be included in your script to work properly.

    I hope that all makes sense to you.

    Cheers,
    Torsten

    #2107606
    Elvin
    Staff
    Customer Support

    Can you open a new topic referencing to this? So you can use the private information text field to provide us the link.

    I’ll just take a look at the site and observe. πŸ™‚ To see what’s the appropriate approach.

    Let us know. πŸ˜€

Viewing 7 posts - 31 through 37 (of 37 total)
  • You must be logged in to reply to this topic.