- This topic has 11 replies, 4 voices, and was last updated 2 years, 6 months ago by
Leo.
-
AuthorPosts
-
October 2, 2018 at 11:22 pm #692115
Walter Schwarz
Site “https://www.drwjs.eu”.
Scrolling down the navigation moves up and stays sticky. That’s what I want.
The “Top Bar” disappears thereby. That I do not want.
I would like to keep the “Top Bar” always visible above the “Navigation Bar”.
The problem seems to be that the “Top Bar” is inner part of the moving container (?) when scrolling.
I did need succeed to fix it.Any hints?
Thank you,
WalterOctober 3, 2018 at 2:41 am #692215David
StaffCustomer SupportHi there,
could you disable the sticky navigation, so i can provide the CSS that would be required to make this work
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 3, 2018 at 2:52 am #692225Walter Schwarz
Hi David,
just finished.
October 3, 2018 at 3:31 am #692247David
StaffCustomer SupportHi there,
add this CSS, note that the #site-navigation top position needs to reflect the height of the top bar, currently that is 21px.
.top-bar { position: -webkit-sticky; position: sticky; top: 0; z-index: 99; } #site-navigation { position: -webkit-sticky; position: sticky; top: 21px; /* This is the height of the top bar */ }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 3, 2018 at 10:02 am #692672Walter Schwarz
Hi David,
thank you so much – it works as expected in Firefox, Chrome and Opera.
IE still slides to top bar into the nirwana … But that does not bother me.October 3, 2018 at 3:25 pm #692874David
StaffCustomer SupportGlad i could be of help π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 3, 2019 at 1:39 pm #1052365Kim
Hi,
Could you please help me out?
I am trying to get both top bar and header sticky. So not only the header. When I enable ‘Sticky Navigation’ I only get a sticky header. So I disabled the sticky navigation and copied the CSS below (after reading support options on this forum) but unfortunately it doesn’t work. Same with any other options I tried.
I hope you can assist! Much appreciated!
Thanks,
Kim.top-bar {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 99;
}
#site-navigation {
position: -webkit-sticky;
position: sticky;
top: 21px; /* This is the height of the top bar */
}November 3, 2019 at 1:48 pm #1052372Leo
StaffCustomer SupportAny chance you can link me to the site in question with the CSS applied?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 3, 2019 at 2:10 pm #1052388Kim
Hi Leo,
I read it in David’s (customer support) comment on this page. Dated October 3, 2018 at 3:31 am.
Do you have an alternative way for me how to get both header AND top bar sticky?Thanks so much!!
November 3, 2019 at 3:17 pm #1052436Leo
StaffCustomer SupportDavid’s way should work so we need to see your site with the code applied to see why it isn’t working.
Can you link us to it?
Feel free to open a new topic so you can use the private URL field as well.
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 3, 2019 at 3:33 pm #1052441Kim
Thank you Leo! I will open a new topic now to use the private URL field.
November 3, 2019 at 9:53 pm #1052519Leo
StaffCustomer SupportSounds good π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.