Archived topic
How to remove jquery.min.js
6 replies · Started by Charbel on October 27, 2022
Hello Team,
I know that GP Premium uses jQuery for the sticky navigation, infinite scroll, and masonry options.
Those will all need to be turned off in order to remove jquery.
I am using only the sticky navigation, can we use an alternate approach to keep sticky navigation without GP Premium, so we can remove jquery.min.js.
A step-by-step guide is highly appreciated.
Google PageSpeed is always complaining about Eliminate render-blocking resources for jquery.min.js.
My site: https://charbelnemnom.com
Many Thanks!
-Charbel
Hi there,
you would need to disable the Sticky Navigation option in the theme.
And the use a CSS solution:
#site-navigation {
position: sticky;
top: 0;
}
Things to note:
There is no transition animation with the CSS method.
If disabling the Sticky Nav, and you still see jQuery loading, then there are other plugins or code that require it.
Thank you @David, much appreciated!
Could you please clarify the transition animation for the Sticky Navigation?
What does it mean?
Do I have transition animation in my Sticky Navigation menu?
Thanks!
-Charbel
See here:
https://docs.generatepress.com/article/sticky-navigation/
You currently have the Transition set to Slide.
The CSS i provided cannot do that. It will simply stick to the top on scroll
Many Thanks, @David!
I will see if None is sufficient, then I will disable Sticky Nav in GP Premium and use the CSS code.
Hello @David,
How can I disable Sticky Nav in GP Premium to stop loading the jquery.min.js?
Do I need to set it to OFF inside Appearance > Customize > Layout > Sticky Navigation, or do I need to disable the entire module in the GeneratePress Menu Plus?
Thanks!
Do I need to set it to OFF inside Appearance > Customize > Layout > Sticky Navigation
Yes.