- This topic has 7 replies, 4 voices, and was last updated 2 years, 8 months ago by David.
-
AuthorPosts
-
July 29, 2021 at 3:55 pm #1876365Mike
Hello,
In the primary menu bar I currently have the site tagline displaying to the right of the logo, however upon scroll the menu becomes sticky and the site tagline disappears leaving an empty space. Is there a way to display two buttons in that area? If so, how can I accomplish that?
Thank you!
July 29, 2021 at 5:21 pm #1876394LeoStaffCustomer SupportHi there,
What if we just make the entire header sticky with this CSS?
.site-header { position: sticky; top: 0; z-index: 999; }
Let me know 🙂
July 29, 2021 at 6:25 pm #1876418MikeThanks Leo, that’s not a bad idea!
But, is there a way to place a button in that space where the tagline is with a navigation hook element? I’m not sure how to only apply it after scroll.
Or to bring the primary menu closer to the logo, and add the button on the right side of the navigation after scroll might make more sense?
July 29, 2021 at 7:49 pm #1876475ElvinStaffCustomer SupportHi Mike,
But, is there a way to place a button in that space where the tagline is with a navigation hook element? I’m not sure how to only apply it after scroll.
You can try this hook –
generate_before_navigation
– and then style it with custom CSS so it only appears when the header is in sticky mode.Or to bring the primary menu closer to the logo, and add the button on the right side of the navigation after scroll might make more sense?
Or you can use this hook –
generate_after_navigation
(after the primary menu) which we can also style as well in a similar manner.you can try these things and tell us when it’s added/hooked to the site so we can inspect the things you’ve added and help out with the CSS write up. 😀
July 30, 2021 at 8:54 pm #1877925MikeThanks Elvin, I appreciate your help!
I have it hooked to generate_after_navigation now.
I’d like it to only appear in sticky menu mode and to decrease the space between the logo and the menu to accommodate for the button hooked to the after navigation.
Thanks!
July 31, 2021 at 8:06 am #1878518DavidStaffCustomer SupportHi there,
that hook won’t work in the Sticky Navigation. Best place for it is in the
generate_menu_bar_items
hook. Then we can provide some CSS to remove it on mobile and static desktop nav.If you can make that change, and also edit the Buttons Block ( the parent container – not the button ) and give it an Advanced > Additional CSS Class of:
sticky-nav-button
Then this CSS:
@media(max-width: 768px) { .gb-button-wrapper.sticky-nav-button { display: none; } } .main-navigation:not(.is_stuck) .gb-button-wrapper.sticky-nav-button { display: none; }
July 31, 2021 at 9:14 am #1878590MikeDavid, that is perfect! I really appreciate the help, you guys are the best!
August 1, 2021 at 4:33 am #1879120DavidStaffCustomer SupportGlad to be of help
-
AuthorPosts
- You must be logged in to reply to this topic.