Archived topic
Sticky navigation
3 replies · Started by Sebastien on February 16, 2020
Hi,
I use Sticky navigation to fix my header at the top of my website.
It works but... it uses Java script.
Even if it is a low weight file: 8,2kb, it requierts jquery-core (/wp-includes/js/jquery/jquery.js) which is heavy: 94,6kb.
Is there a way to do the same thing in CSS only? that would allow me to ban jquery.js file.
tahnsk
Hi there,
without the transition, yes you can use this:
#site-navigation {
position: -webkit-sticky;
position: sticky;
top: 0;
}
hey David,
it doesn't seem to work into my website.
Aah you have a merged header so you would have to stick the entire header like so:
.header-wrap {
position: -webkit-sticky;
position: sticky;
top: 0;
}