- This topic has 29 replies, 5 voices, and was last updated 7 years, 4 months ago by
Leo.
-
AuthorPosts
-
June 11, 2016 at 11:01 am #201114
Tom
Lead DeveloperLead DeveloperI just editing your CSS – try it now ๐
June 11, 2016 at 11:14 am #201118mc208
That fixed the home page for the main navigation. Secondary navigation is missing. Also, on other pages, no navigation is showing, only the site logo is showing…. Getting closer. I wouldn’t have embarked on this if I knew it was going to be so much work to get this idea to work =(
June 11, 2016 at 11:49 am #201134Tom
Lead DeveloperLead DeveloperGetting close – sometimes things take a lot of tweaking to get working right, that’s just web development ๐
Try this:
.home .site-header, .home .main-navigation, .home .secondary-navigation { display: none; } .home .site-header.hasScrolled, .home .main-navigation.hasScrolled, .home .secondary-navigation.hasScrolled { display: block; } .home .secondary-navigation.hasScrolled { position: fixed; top: 0; width: 100%; z-index: 9999; } .home .site-header.hasScrolled { position: fixed; top: 40px; width: 100%; z-index: 9999; }
June 11, 2016 at 11:56 am #201137mc208
you’re right, it IS getting closer! The other pages seem to be fine now. Only issue on the home page now is that the secondary (top) navigation menu isn’t showing up. But now that I think about it, it is supposed to disappear when you scroll down which means it will never be visible on the homepage and that’s probably not good either! Crud.. now after all that, I am rethinking this whole idea of hiding the menu until scroll down. What do you think?
June 11, 2016 at 11:58 am #201138Tom
Lead DeveloperLead DeveloperI’m seeing the secondary navigation: http://screencast.com/t/v1eChIpL
June 11, 2016 at 12:01 pm #201139mc208
You’re right, the admin login thing at the top was covering it, as soon as I logged out it showed up. I think it’s good now – thank you for your help again!!
June 11, 2016 at 12:02 pm #201140Tom
Lead DeveloperLead DeveloperYou’re welcome ๐
August 10, 2017 at 1:06 pm #363413David
This is cool Tom, but would it possible to have it show the sticky navigation on scroll down, so that it matches the rest of the site pages when sticky navigation is being used with a reduced depth?
August 10, 2017 at 1:25 pm #363432Leo
StaffCustomer SupportHi David,
Not too sure what you mean? Would something like this help? https://docs.generatepress.com/article/navigation-logo/#navigation-as-header
If not then it might be best to open a new topic and give a little more info on what you would like to achieve.
Thanks! ๐
August 10, 2017 at 1:31 pm #363438David
Hi Leo, thanks for the quick response, I followed this topic and used Tom’s code on a site I’ve just started and it worked great, but I am using sticky navigation on all pages with a reduced depth compared to the main nav, so wanted the sticky nav to appear on the home page when I scroll down instead of the standard main nav appearing when I scroll down.
Another thing I am now trying to figure out is how to add a transparent background color to the sticky nav, is this possible?
August 10, 2017 at 1:55 pm #363468Leo
StaffCustomer SupportSorry still not quite sure what you mean about the depth part. Any chance you can link me to the site?
Preferably in a new topic ๐ This post is over a year old and sticky navigation has been rewrite since then.
Thanks!
August 10, 2017 at 2:02 pm #363477David
Hi Leo
Thanks again for quick response, still on local dev at the moment. I’ll see if I can figure this out and if not open a topic when the site is online.
Thanks again ๐August 10, 2017 at 2:08 pm #363484Leo
StaffCustomer SupportOk sounds good.
Gonna take a guess that something like this might be what you are hoping to achieve? https://docs.generatepress.com/article/navigation-logo/#navigation-as-header
A screenshot might also help as well ๐
April 24, 2018 at 3:49 am #558865generator
Hello,
I want to achieve the same:
sticky menu, show only when scrolled down
I tried the CSS-codes which I found on your page. But both make it disappear permanently.
.main-navigation:not(.navigation-stick) { display: none;}
.main-navigation { display: none; } .main-navigation.navigation-clone { display: block; }
I want it “display:none” on top of the page
and “sticky + display” when scrolled downI have the premium version.
Already created the Split Menu, but everything else is still quite on default.April 24, 2018 at 8:50 am #559198Leo
StaffCustomer SupportHi there,
Any chance you can open a new topic for your question?
Thanks ๐
-
AuthorPosts
- You must be logged in to reply to this topic.